nix-build is copying files from store to store #711
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#711
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
nix-build, (and nix-instantiate --eval too) is logging
copying '/nix/store/91vybbg..snip' to the store
, implying that it's copying files from the store to the store which seems wrong? unexpected at least. running the same command withnixVersions.stable
logshashing '/nix/store/91vybbg..snip'
and takes very comparable time to evaluate, so this might be only a UI issue and i'm being concerned over nothing?Steps To Reproduce
(the same message is logged for every touched file in nixpkgs)
Comparison to CppNix
I'm not actually sure if there is a difference in behaviour or just the log message but the same steps for
nix (Nix) 2.24.12
(nixVersions.stable
from nixpkgs) producenix --version
outputnix (Lix, like Nix) 2.93.0-dev-pre20250301-20fea96
but nothing changes withnix (Lix, like Nix) 2.91.1
eitherIt should not be related to https://github.com/NixOS/nix/issues/11228#issuecomment-2261087599 since the path it's copying from is called
store
😅that's a side effect of how nixos implements flake-based search paths:
<nixpkgs>
is not an absolute path but a flake reference, and that reference must pass through the fetcher infrastructure before the evaluator can use it. this fetching is harmless when the path is already present, but it does happen and is logged accordingly. if the flake reference weren't for a path in the store you'd see that flakeref as being fetched:cppnix must do the same thing, only difference may be that it doesn't log anything while fetching a store path as a flake. it seems that it does log the same things though, at least on 2.24 from nixpkgs
aha, sorry, i've tried simplifying the reproducer until i've changed it into something else. i've first noticed this with a npins repository where i don't use the
<nixpkgs>
syntax at all.i've tried making a smaller reproducer that avoids nixpkgs completely, i still get a (one) log line about copying a file to the store that is already present in the store before the nix-build command is run.
instead of nixpkgs i've made a trivial derivation which depends on a single file (it doesn't work but that doesn't matter, the log line still appears).
and i'm sorry i probably didn't write it clearly which log lines i'm surprised by. here it's the
in the description it was this for lix
replaced by this for cppnix
ah, i see now. yeah, that message is unfortunate and could definitely be improved. we can't really do much about it in the near term though due to how the code that reads things is structured :(