about summary refs log tree commit diff
path: root/src/nix-build
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-10-19T13·21+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-10-19T13·21+0200
commit19c278de89fa60844fa1ea2b3c2abfa639f75b39 (patch)
tree089445b32e188f8eb3bf25ac93a3807df58eead9 /src/nix-build
parentaf3db853fa273b44ccffbbd62357a0451ecb6725 (diff)
Fix Darwin build
Done slightly differently from https://github.com/NixOS/nix/pull/1093.
Diffstat (limited to 'src/nix-build')
-rwxr-xr-xsrc/nix-build/nix-build.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index b209464b8279..08c6793577a4 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -16,6 +16,8 @@
 
 using namespace nix;
 
+extern char * * environ;
+
 /* Recreate the effect of the perl shellwords function, breaking up a
  * string into arguments like a shell word, including escapes
  */
@@ -448,9 +450,10 @@ int main(int argc, char ** argv)
                     ? Strings{"bash", "--rcfile", rcfile}
                     : Strings{"bash", rcfile};
 
-                execvpe(getEnv("NIX_BUILD_SHELL", "bash").c_str(),
-                        stringsToCharPtrs(args).data(),
-                        stringsToCharPtrs(envStrs).data());
+                environ = stringsToCharPtrs(envStrs).data();
+
+                execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(),
+                    stringsToCharPtrs(args).data());
 
                 throw SysError("executing shell");
             }
@@ -507,4 +510,3 @@ int main(int argc, char ** argv)
         }
     });
 }
-