getDerivations deduplicates derivations *sometimes* #10
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#10
Loading…
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?
our upstream fix for nixos/nix#9149 made a bug in getDerivations apparent: nixos/nix#10132. this happens because getDerivations deduplicates not on the drvPath or attrpath or something sensible like that, but on the raw evaluator-internal attrset pointer that describes both derivations and sets of derivations. getDerivation is also used everywhere, including in flake paths.
we propose to move deduplication up one step and deduplicate only the structures containing derivations so we won't inf-recurse on self-referential sets (or lists, which getDerivations also picks apart). since this will only produce more derivations (in accordance with the structure of the input values) and existing tooling already has to be able to deal with duplication that was previously not eliminated we don't think this we be a problem, but actually a strict improvement.
thoughts?
(for context, this is holding up backports of the fix to the nixos/nix#9149 because it causes vm tests to fail. the alternative would be to hack the test for the new facts, but since that will drop existing items from getDerivations results it seems more dangerous to fix the test.)
As this behaviour is likely to change when other evaluator changes are applied, my thoughts are that we should remove the deduplication, and only do the bare minimum of deduplication to avoid infinite recursion. There's already no guarantee that the same derivation may have the same pointer in all locations (e.g. when instantiating multiple nixpkgs somehow).
fixed by https://gerrit.lix.systems/c/lix/+/389