1
0
Fork 0
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:
Bernardo Meurer 2021-03-03 14:46:15 -08:00
parent 3cdd464212
commit da1629d744
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -425,6 +425,7 @@ static void _main(int argc, char * * argv)
"unset NIX_ENFORCE_PURITY; "
"shopt -u nullglob; "
"unset TZ; %6%"
"shopt -s execfail;"
"%7%",
(Path) tmpDir,
(pure ? "" : "p=$PATH; "),