-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugnix-shellnix-shell, nix develop, nix print-dev-env, etcnix-shell, nix develop, nix print-dev-env, etcregressionSomething doesn't work anymoreSomething doesn't work anymore
Description
Describe the bug
I used to be able to write a self-contained nix-shell script that referenced a package definition, for example:
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/bff917a3ed37b1f9e705b5c07210acd295691770.tar.gz
#! nix-shell -p 'callPackage (import ./my_package.nix) {}'
trueIn 2.24 and the current Nix master, this fails with:
~/nix-test $ ./test.sh
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/l3bc30i71qshxa3mdj3dy8dj7zwqkh6s-source/pkgs/stdenv/generic/make-derivation.nix:300:7
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/l3bc30i71qshxa3mdj3dy8dj7zwqkh6s-source/pkgs/stdenv/generic/make-derivation.nix:347:7:
346| depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0;
347| buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1;
| ^
348| depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: path '/home/vladimir/nix-test/{...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (callPackage (import ./my_package.nix) {}) ]; } ""/my_package.nix' does not exist
Nix now seems to try to construct a non-sensical path by concatenating the auto-generated shell expression with /my_package.nix.
nix-env --version output
nix-env (Nix) 2.24.0pre20240706_4c59d6e
Additional context
The regression seems to have been introduced in #11058.
Priorities
Add 👍 to issues you find important.
Metadata
Metadata
Assignees
Labels
bugnix-shellnix-shell, nix develop, nix print-dev-env, etcnix-shell, nix develop, nix print-dev-env, etcregressionSomething doesn't work anymoreSomething doesn't work anymore