about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-01T13·46+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-01T15·30+0200
commitd7653dfc6dea076ecbe00520c6137977e0fced35 (patch)
tree79d59cdf8385c8e36bee4cf04cd2364b9e267629 /src/libstore/build.cc
parentca9f589a93309ca548d772f1634169007568d6a0 (diff)
Remove $NIX_BUILD_HOOK and $NIX_CURRENT_LOAD
This is to simplify remote build configuration. These environment
variables predate nix.conf.

The build hook now has a sensible default (namely build-remote).

The current load is kept in the Nix state directory now.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index a0efd880400c..9b3f799b9f2f 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -583,11 +583,7 @@ struct HookInstance
 
 HookInstance::HookInstance()
 {
-    debug("starting build hook");
-
-    Path buildHook = getEnv("NIX_BUILD_HOOK");
-    if (string(buildHook, 0, 1) != "/") buildHook = settings.nixLibexecDir + "/nix/" + buildHook;
-    buildHook = canonPath(buildHook);
+    debug("starting build hook ‘%s’", settings.buildHook);
 
     /* Create a pipe to get the output of the child. */
     fromHook.create();
@@ -621,9 +617,9 @@ HookInstance::HookInstance()
             std::to_string(verbosity)
         };
 
-        execv(buildHook.c_str(), stringsToCharPtrs(args).data());
+        execv(settings.buildHook.get().c_str(), stringsToCharPtrs(args).data());
 
-        throw SysError(format("executing ‘%1%’") % buildHook);
+        throw SysError("executing ‘%s’", settings.buildHook);
     });
 
     pid.setSeparatePG(true);
@@ -1569,7 +1565,7 @@ void DerivationGoal::buildDone()
 
 HookReply DerivationGoal::tryBuildHook()
 {
-    if (!settings.useBuildHook || getEnv("NIX_BUILD_HOOK") == "" || !useDerivation) return rpDecline;
+    if (!settings.useBuildHook || !useDerivation) return rpDecline;
 
     if (!worker.hook)
         worker.hook = std::make_unique<HookInstance>();