-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaring an unused variable called "extensions" leads to an assersion failure evaluating NixOS #8701
Comments
I am pasting the evaluation failure log from our Hydra instance here in the hope that it shows up in search results and saves people debugging time.
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-language-evaluation-bug/30582/2 |
This is a bug (which I caused) in The fix is This particular bug filed against Nix should be closed. |
I've seen my system configuration failing to evaluate non-reproducibly with this assert. Arguably, this non-determinism is a Nix bug. I think the comparison should have at least a well-defined order (eager is probably too slow). |
I agree with this, especially as there is no reasonable expectation for the examples I gave to change this behaviour - the neighbouring |
Even if people don't consider this a bug, we should somehow catch this behavior to make sure this doesn't happen in the wild (or document it somewhere prominently). Even though I consider myself pretty seasoned in terms of Nix hacking, I would've started questioning my sanity if I stumbled upon this behavior. EDIT: AFAIU without the |
Describe the bug
Since NixOS/nixpkgs@6980e6b, some part of NixOS seems to fail to evaluate completely if a variable called
extensions
has been declared.Steps To Reproduce
Here are two similar examples that reproduce this problem. Test them with
nix-instantiate path/to/file.nix
. A copy of Nixpkgs with the aforementioned commit (nixos-unstable
or newer at the time of writing) is assumed to be in the Nix path.Example 1:
This demonstrates the issue simply.
extensions
should not have any effect on evaluation, but it does. Renaming or removingextensions
prevents the issue from occurring.Example 2:
This is a little more nuanced. If either
extensions
is renamed/removed, or the use oflib.optionals
is removed, the issue does not occur. Indeed, it seems like a closer-to-the-root cause of the first example is due topkgs.nixos
using similar library functions.Expected behavior
Evaluation should not be affected by the presence of the
extensions
variable.nix-env --version
outputTested on the following:
nix-env (Nix) 2.15.1
(x86_64-linux
)nix-env (Nix) 2.16.1
(aarch64-linux
)Additional context
The issue occurs both with and without
GC_DONT_GC=true
.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: