about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/build-remote.pl.in7
-rw-r--r--src/libstore/build.cc2
2 files changed, 5 insertions, 4 deletions
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in
index 631aba68080c..458d31be92f8 100755
--- a/scripts/build-remote.pl.in
+++ b/scripts/build-remote.pl.in
@@ -46,8 +46,7 @@ sub all { $_ || return 0 for @_; 1 }
 # Initialisation.
 my $loadIncreased = 0;
 
-my ($localSystem, $maxSilentTime, $printBuildTrace) = @ARGV;
-$maxSilentTime = 0 unless defined $maxSilentTime;
+my ($localSystem, $maxSilentTime, $printBuildTrace, $buildTimeout) = @ARGV;
 
 my $currentLoad = $ENV{"NIX_CURRENT_LOAD"};
 my $conf = $ENV{"NIX_REMOTE_SYSTEMS"};
@@ -258,7 +257,9 @@ close UPLOADLOCK;
 
 
 # Perform the build.
-my $buildFlags = "--max-silent-time $maxSilentTime --fallback --add-root $rootsDir/\$PPID.out --option verbosity 0";
+my $buildFlags =
+    "--max-silent-time $maxSilentTime --option build-timeout $buildTimeout "
+    . "--fallback --add-root $rootsDir/\$PPID.out --option verbosity 0";
 
 # We let the remote side kill its process group when the connection is
 # closed unexpectedly.  This is necessary to ensure that no processes
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e94c6b7939ed..7fc47f3f5294 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -690,10 +690,10 @@ HookInstance::HookInstance()
             if (dup2(builderOut.writeSide, 4) == -1)
                 throw SysError("dupping builder's stdout/stderr");
 
-            /* XXX: Pass `buildTimeout' to the hook?  */
             execl(buildHook.c_str(), buildHook.c_str(), settings.thisSystem.c_str(),
                 (format("%1%") % settings.maxSilentTime).str().c_str(),
                 (format("%1%") % settings.printBuildTrace).str().c_str(),
+                (format("%1%") % settings.buildTimeout).str().c_str(),
                 NULL);
 
             throw SysError(format("executing `%1%'") % buildHook);