diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-02-24T16·25+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-02-24T16·25+0100 |
commit | d3e1aad421a88a7a075cac25142c49224b3ecca2 (patch) | |
tree | 1bb5e4edcdd69ac4777aa49087e9a53317e4d690 /src/nix-build | |
parent | e76df9bd5285272f025025d97fe8993156726eef (diff) |
nix-shell: Better error message when the shell can't be started
Diffstat (limited to 'src/nix-build')
-rwxr-xr-x | src/nix-build/nix-build.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index f4484ba572d3..b81c98868e61 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -448,15 +448,17 @@ int main(int argc, char ** argv) auto envPtrs = stringsToCharPtrs(envStrs); + auto shell = getEnv("NIX_BUILD_SHELL", "bash"); + environ = envPtrs.data(); auto argPtrs = stringsToCharPtrs(args); restoreSignals(); - execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(), argPtrs.data()); + execvp(shell.c_str(), argPtrs.data()); - throw SysError("executing shell"); + throw SysError("executing shell ‘%s’", shell); } // Ugly hackery to make "nix-build -A foo.all" produce symlinks |