mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
nix-build: set execfail
When starting a nix-shell with `-i` it was previously possible for it to
silently fail in the scenario where the specified interpreter didn't
exist. This happened due to the `exec` call masking the issue.
With this change we enable `execfail`, which causes the script using
`nix-shell` as interpreter to correctly exit with code 127.
Fixes: #4598
(cherry picked from commit 6e849e3b0a
)
This commit is contained in:
parent
3cdd464212
commit
da1629d744
1 changed files with 1 additions and 0 deletions
|
@ -425,6 +425,7 @@ static void _main(int argc, char * * argv)
|
||||||
"unset NIX_ENFORCE_PURITY; "
|
"unset NIX_ENFORCE_PURITY; "
|
||||||
"shopt -u nullglob; "
|
"shopt -u nullglob; "
|
||||||
"unset TZ; %6%"
|
"unset TZ; %6%"
|
||||||
|
"shopt -s execfail;"
|
||||||
"%7%",
|
"%7%",
|
||||||
(Path) tmpDir,
|
(Path) tmpDir,
|
||||||
(pure ? "" : "p=$PATH; "),
|
(pure ? "" : "p=$PATH; "),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue