diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 2cdd0898..cb6c0488 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -155,17 +155,19 @@ void State::buildRemote(std::shared_ptr store, /* Handshake. */ bool sendDerivation = true; + unsigned int remoteVersion; + try { - to << SERVE_MAGIC_1 << SERVE_PROTOCOL_VERSION; + to << SERVE_MAGIC_1 << 0x202; to.flush(); unsigned int magic = readInt(from); if (magic != SERVE_MAGIC_2) throw Error(format("protocol mismatch with ‘nix-store --serve’ on ‘%1%’") % machine->sshName); - unsigned int version = readInt(from); - if (GET_PROTOCOL_MAJOR(version) != 0x200) + remoteVersion = readInt(from); + if (GET_PROTOCOL_MAJOR(remoteVersion) != 0x200) throw Error(format("unsupported ‘nix-store --serve’ protocol version on ‘%1%’") % machine->sshName); - if (GET_PROTOCOL_MINOR(version) >= 1) + if (GET_PROTOCOL_MINOR(remoteVersion) >= 1) sendDerivation = false; } catch (EndOfFile & e) { @@ -237,10 +239,12 @@ void State::buildRemote(std::shared_ptr store, printMsg(lvlDebug, format("building ‘%1%’ on ‘%2%’") % step->drvPath % machine->sshName); if (sendDerivation) - to << cmdBuildPaths << PathSet({step->drvPath}) << maxSilentTime << buildTimeout; + to << cmdBuildPaths << PathSet({step->drvPath}); else - to << cmdBuildDerivation << step->drvPath << basicDrv << maxSilentTime << buildTimeout; - // FIXME: send maxLogSize. + to << cmdBuildDerivation << step->drvPath << basicDrv; + to << maxSilentTime << buildTimeout; + if (GET_PROTOCOL_MINOR(remoteVersion) >= 2) + to << 64 * 1024 * 1024; // == maxLogSize to.flush(); result.startTime = time(0); diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index 322863f8..d13c545c 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -300,10 +300,12 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, BuildStatus buildStatus = result.status == BuildResult::TimedOut ? bsTimedOut : + result.status == BuildResult::LogLimitExceeded ? bsLogLimitExceeded : result.canRetry() ? bsAborted : bsFailed; BuildStepStatus buildStepStatus = result.status == BuildResult::TimedOut ? bssTimedOut : + result.status == BuildResult::LogLimitExceeded ? bssLogLimitExceeded : result.canRetry() ? bssAborted : bssFailed; @@ -312,7 +314,8 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, if (result.status == BuildResult::PermanentFailure || result.status == BuildResult::TransientFailure || result.status == BuildResult::CachedFailure || - result.status == BuildResult::TimedOut) + result.status == BuildResult::TimedOut || + result.status == BuildResult::LogLimitExceeded) result.errorMsg = ""; /* Create failed build steps for every build that depends diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 8c4a37d1..838338aa 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -30,6 +30,7 @@ typedef enum { bsFailedWithOutput = 6, bsTimedOut = 7, bsUnsupported = 9, + bsLogLimitExceeded = 10, } BuildStatus; @@ -40,6 +41,7 @@ typedef enum { bssTimedOut = 7, bssCachedFailure = 8, bssUnsupported = 9, + bssLogLimitExceeded = 10, bssBusy = 100, // not stored } BuildStepStatus; diff --git a/src/root/build.tt b/src/root/build.tt index 44fe8456..d56988e2 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -59,6 +59,8 @@ Cached failure [% ELSIF step.status == 9 %] Unsupported system type + [% ELSIF step.status == 10 %] + Log limit exceeded [% ELSIF step.errormsg %] Failed: [% HTML.escape(step.errormsg) %] [% ELSE %] diff --git a/src/root/common.tt b/src/root/common.tt index 6acea0c6..b4d21385 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -206,6 +206,8 @@ BLOCK renderBuildStatusIcon; Failed with output [% ELSIF buildstatus == 7 %] Timed out + [% ELSIF buildstatus == 10 %] + Log limit exceeded [% ELSE %] Failed [% END; @@ -235,6 +237,8 @@ BLOCK renderStatus; Timed out [% ELSIF buildstatus == 9 %] Unsupported system type + [% ELSIF buildstatus == 10 %] + Log limit exceeded [% ELSE %] Aborted (Hydra failure; see below) diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 15766402..f43de8e7 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -195,6 +195,7 @@ create table Builds ( -- 6 = failure with output -- 7 = timed out -- 9 = unsupported system type + -- 10 = log limit exceeded buildStatus integer, errorMsg text, -- error message in case of a Nix failure @@ -266,6 +267,7 @@ create table BuildSteps ( -- 7 = timed out -- 8 = cached failure -- 9 = unsupported system type + -- 10 = log limit exceeded status integer, errorMsg text,