Overlaying nix
does not propagate up to NixOS systems definitions #1
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#1
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?
Describe the bug
Overlaying
nixVersions.stable
does not propagate to NixOS tests/systems, hinting at nixpkgs reimportation happening somewhere in-between.Steps To Reproduce
@pennae could you provide a reproducer?
Expected behavior
It should pass the overlayed
nixVersions.stable
to the systems.should fail, but does not. building
-A nix
instead fails as expectedCause identified:
3794246066/nixos/modules/misc/nixpkgs.nix (L71-L94)
Now, what to do about it, that is a much harder question to answer :(
I spot a TODO though, and I think it is exactly the right spot to do it:
b8698cd8d6/nixos/lib/testing/pkgs.nix (L11-L13)
I don't think there is a bug here (or in other words, I believe things are working as intended). The reason you don't get a build failure is because
nixosTests.misc
doesn't usenix
at all. However, if you add the following change to./nixos/tests/misc.nix
:Then the reproduction now fails in the way you expected
Gabriella: i think that is somewhat plausible as well but I've found via debugger that it is reimporting nixpkgs at some point due to a clear cut case of the testing framework not stopping that so even if the test is using nix, it might not pick up the overlayed version? Unsure how our results fit together.
My best guess is that reason for the reimport of Nixpkgs is this:
4f7fd6dded/pkgs/build-support/testers/default.nix (L126)
The NixOS tests use
pkgsLinux
which (if you're on a non-Linux system) will reimport Nixpkgs but still with the same overlays as before just with a differentsystem
argument:bc50837c0e/pkgs/top-level/stage.nix (L247-L255)
If you're already on a Linux system then I'm not sure why the second reimport of Nixpkgs is happening, but either way my intuition here is that the second reimport of Nixpkgs is probably still reusing the same set of overlays as the original import of Nixpkgs.
huhhhh, that first module should surely be in there when running on Linux but is not working at least. weird.
This issue was mentioned on Gerrit on the following CLs: