-
-
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
nix-shell
breaks with an eval-error in nixpkgs
with Nix 3.0pre
#4003
Comments
this kinda seems to me like nixpkgs is relying on incorrect behavior in nix. Could we just add an ellipsis to the function in |
For a full description of the underlying issue please read NixOS/nix#4003
@glittershark that's what I've done in NixOS/nixpkgs#97807. I think that we should document this here as well (and probably catch this kind of error just in case other setups are having it as well now) before closing this issue :) |
For a full description of the underlying issue please read NixOS/nix#4003 (cherry picked from commit fa6064a)
For a full description of the underlying issue please read NixOS/nix#4003 (cherry picked from commit fa6064a)
I marked this as stale due to inactivity. → More info |
Should be fixed now in nixpkgs. |
For a full description of the underlying issue please read NixOS/nix#4003 (cherry picked from commit fa6064a)
Describe the bug
Running
nix-shell
on anynixpkgs
checkout (checked on 1d60af77224f25a0c428b21a34463ed1719caa27) fails with the following error on Nix 3.0:Expected behavior
Getting an open
nix-shell
.nix-env --version
outputAdditional context
I didn't have the issue on
2.4pre20200721_ff314f1
and identified 6262007 (from #3965) to be the problem. Reverting this commit on top of 77d4758 fixes the issue.The patch 6262007 fixes a bug where auto-calling a function
a@{ ... }: a
is missing all extra-arguments when being called from CLI withnix-instantiate --argstr arg value
as the evaluator only added the attributes that were defined in the{ ... }
-expression.While this fixes an actual bug, this breaks
pkgs/top-level/impure.nix
fromnixpkgs
since this file defines a function with an ellipsis. And all argumentsa@{ ... }
from this function get passed topkgs/top-level/default.nix
which defines a function without an ellipsis.Previously everything worked fine since
a@{ ... }
inimpure.nix
didn't have the valueinNixShell
(which gets passed to an expression in ashell.nix
since 9d612c3). SinceinNixShel
isn't defined in the argument-list ofpkgs/top-level/default.nix
andinNixShell
gets passed to this function, the evaluation withnix-shell
is breaking now.I acknowledge that 6262007 fixes an actual bug and shouldn't be reverted. However I'm not so sure what's the best solution for the kind of problem I described in this issue: the easiest fix for
nixpkgs
would be to removeinNixShell
from the attr-set that gets passed todefault.nix
. However we should document theinNixShell
-value at least. Also I'm wondering if we should catch this error and explain thatinNixShell
is most likely the cause.cc @edolstra @glittershark
The text was updated successfully, but these errors were encountered: