hydra: add support for succeedOnFailure feature in stdenv

This commit is contained in:
Rob Vermaas 2010-12-22 14:55:05 +00:00
parent 496c22dc0f
commit 039d1bed21
2 changed files with 16 additions and 2 deletions

View file

@ -217,6 +217,8 @@
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSIF build.resultInfo.buildstatus == 5 %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSIF build.resultInfo.buildstatus == 6 %]
<img src="/static/images/error_[% size %].png" alt="Failed (with result)" />
[% ELSE %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% END %]
@ -246,6 +248,9 @@
<span class="error">Build inhibited because a dependency previously failed to build</span>
[% failedDep = build.resultInfo.failedDep %]
(namely, <a href="[% c.uri_for('/build' failedDep.build.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>)
[% ELSIF build.resultInfo.buildstatus == 6 %]
<img src="/static/images/failure.gif" alt="Failed (with result)" />
<span class="error">Build failed (with result)</span>
[% ELSE %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build failed</span>

View file

@ -279,7 +279,14 @@ sub doBuild {
my $drvPathStep = $1;
txn_do($db, sub {
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
$step->update({busy => 0, status => 0, stoptime => time});
my $stepOutpath = $step->outpath;
my $stepStatus = 0;
# when $out/nix-support/failed exists, build actually failed, exit code is in the file, status code for such builds is 6
$stepStatus = 6 if -f "$stepOutpath/nix-support/failed";
$thisBuildFailed = 1 if ($drvPath eq $drvPathStep && $stepStatus == 6);
$step->update({busy => 0, status => $stepStatus, stoptime => time});
});
}
@ -358,6 +365,8 @@ sub doBuild {
if ($thisBuildFailed) { $buildStatus = 1; }
elsif ($someBuildFailed) { $buildStatus = 2; }
else { $buildStatus = 3; }
} else {
$buildStatus = 6 if $thisBuildFailed;
}
# Only store the output of running Nix if we have a miscellaneous error.
@ -402,7 +411,7 @@ sub doBuild {
, releasename => $releaseName
});
if ($buildStatus == 0) {
if ($buildStatus == 0 || $buildStatus == 6) {
addBuildProducts($db, $build);
}