From 9ac3f5df9c29e35b38539c3dca753eacc9b1393d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 4 Dec 2008 16:51:16 +0000 Subject: [PATCH] * Propagate --max-silent-time to remote machines. --- scripts/build-remote.pl.in | 8 ++++++-- src/libstore/build.cc | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in index fe2fbaf89..76afccd35 100755 --- a/scripts/build-remote.pl.in +++ b/scripts/build-remote.pl.in @@ -23,8 +23,9 @@ use English '-no_match_vars'; my $loadIncreased = 0; -my ($amWilling, $localSystem, $neededSystem, $drvPath, $mustRun) = @ARGV; +my ($amWilling, $localSystem, $neededSystem, $drvPath, $mustRun, $maxSilentTime) = @ARGV; $mustRun = 0 unless defined $mustRun; +$maxSilentTime = 0 unless defined $maxSilentTime; sub sendReply { my $reply = shift; @@ -184,12 +185,15 @@ system("NIX_SSHOPTS=\"$sshOpts\" nix-copy-closure $hostName $maybeSign $drvPath print "BUILDING...\n"; +my $buildFlags = ""; +$buildFlags .= " --max-silent-time $maxSilentTime"; + # `-tt' forces allocation of a pseudo-terminal. This is required to # make the remote nix-store process receive a signal when the # connection dies. Without it, the remote process might continue to # run indefinitely (that is, until it next tries to write to # stdout/stderr). -system("ssh -tt $sshOpts $hostName 'nix-store -rvvK $drvPath'") == 0 +system("ssh -tt $sshOpts $hostName 'nix-store -rvvK $buildFlags $drvPath'") == 0 or die "remote build on $hostName failed: $?"; print "REMOTE BUILD DONE: $drvPath on $hostName\n"; diff --git a/src/libstore/build.cc b/src/libstore/build.cc index fbec67598..6a3ba0f1c 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1301,6 +1301,7 @@ DerivationGoal::HookReply DerivationGoal::tryBuildHook() drv.platform.c_str(), drvPath.c_str(), (worker.canPostpone() ? (string) "0" : "1").c_str(), + (format("%1%") % maxSilentTime).str().c_str(), NULL); throw SysError(format("executing `%1%'") % buildHook);