Erroneous download size for compressed nars #967
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#967
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
The download progress for compressed nars is erroneous when the nar is compressed on the fly.
Steps To Reproduce
Then, the download size is shown to be the same as the unpacked size, even though the nar is zstd-compressed on the fly by the cache.
C.f.
(This does not happen if the nars are pre-compressed and the downloaded files are ...nar.zstd for example)
Expected behavior
Show the correct download size (e.g. the size of the compressed file)
nix --version
outputnix (Lix, like Nix) 2.94.0-dev-8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/thubrecht/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/thubrecht/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/thubrecht/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/thubrecht/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/wzvcw93ncl4cnw7062mn77q4ym2hmxb1-gnome-settings-daemon-48.1/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/9zi2cvapl6v92dbk4czfwqfq5h68y6d9-lix-2.94.0-dev-8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb/share
Additional context
Add any other context about the problem here.
I think this is a snix cache bug IIRC cc @flokli as snix doesn't communicate the right sizes in its narinfo or its responses.
We communicate the right sizes. The zstd compression is only happening via accept-encoding on the transport level, content-length and FileSize are equal to the uncompressed NAR size.
we'd just delete the "downloaded" progress meters entirely. they're pretty much meaningless since curl decompresses some things but not others, and in general they're not indicative of the overall progress of the operation anyway. a meter for current overall transfer rate might be a lot more useful (but entirely impossible because the wire protocol is complete garbage and cannot be changed).