exportReferencesGraph of a storepath of a drv does not match the closure of it's context #1039
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
awaiting
author
awaiting
contributors
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
Feature/S3
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#1039
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?
Consider the following code:
One would expect
references-graph.jsonto contain the closure of the context ofdrvStorePath, that is the closure of the derivation without it's outputs, matching the output ofnix-store -qR /nix/store/lh2pxynz5f9yccmlhx7xhgh7w9r8ifc2-hello-2.12.1.drv.Instead it produces that same referencesGraph as if
drvStorePath = pkg.drvPath(which has the context{ ${drvPath} = { allOutputs = true; }; }), and the build will fail if anything in the closure of the outputs does not already exists in the store due to the mismatch with the context.There does not seem to be a current way to use
exportReferencesGraphto interrogate the closure of just a derivation and not it's outputs.context is completely discarded by the time the reference graph generation runs, only store paths remain known. since only store paths are known we cannot encode how to handle derivations multiple ways depending on user wishes, instead it always uses the old (and removed) interpretation of drv paths as "that and all outputs".
correct, we'd have to add a new primitive to do that
I think the fact that the build can fail indicates that this is in fact a bug. It's not really due to the unsafeDiscardString context because you can produce the the same string/context with builtins.storePath. I do take your point that since the issue is on the realization side, it would need a new construct in order to not change the meaning of existing derivations.