forked from lix-project/hydra
hydra: add support for succeedOnFailure feature in stdenv
This commit is contained in:
parent
496c22dc0f
commit
039d1bed21
2 changed files with 16 additions and 2 deletions
|
@ -217,6 +217,8 @@
|
||||||
<img src="/static/images/error_[% size %].png" alt="Failed" />
|
<img src="/static/images/error_[% size %].png" alt="Failed" />
|
||||||
[% ELSIF build.resultInfo.buildstatus == 5 %]
|
[% ELSIF build.resultInfo.buildstatus == 5 %]
|
||||||
<img src="/static/images/error_[% size %].png" alt="Failed" />
|
<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 %]
|
[% ELSE %]
|
||||||
<img src="/static/images/error_[% size %].png" alt="Failed" />
|
<img src="/static/images/error_[% size %].png" alt="Failed" />
|
||||||
[% END %]
|
[% END %]
|
||||||
|
@ -246,6 +248,9 @@
|
||||||
<span class="error">Build inhibited because a dependency previously failed to build</span>
|
<span class="error">Build inhibited because a dependency previously failed to build</span>
|
||||||
[% failedDep = build.resultInfo.failedDep %]
|
[% failedDep = build.resultInfo.failedDep %]
|
||||||
(namely, <a href="[% c.uri_for('/build' failedDep.build.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>)
|
(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 %]
|
[% ELSE %]
|
||||||
<img src="/static/images/failure.gif" alt="Failed" />
|
<img src="/static/images/failure.gif" alt="Failed" />
|
||||||
<span class="error">Build failed</span>
|
<span class="error">Build failed</span>
|
||||||
|
|
|
@ -279,7 +279,14 @@ sub doBuild {
|
||||||
my $drvPathStep = $1;
|
my $drvPathStep = $1;
|
||||||
txn_do($db, sub {
|
txn_do($db, sub {
|
||||||
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
|
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; }
|
if ($thisBuildFailed) { $buildStatus = 1; }
|
||||||
elsif ($someBuildFailed) { $buildStatus = 2; }
|
elsif ($someBuildFailed) { $buildStatus = 2; }
|
||||||
else { $buildStatus = 3; }
|
else { $buildStatus = 3; }
|
||||||
|
} else {
|
||||||
|
$buildStatus = 6 if $thisBuildFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only store the output of running Nix if we have a miscellaneous error.
|
# Only store the output of running Nix if we have a miscellaneous error.
|
||||||
|
@ -402,7 +411,7 @@ sub doBuild {
|
||||||
, releasename => $releaseName
|
, releasename => $releaseName
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($buildStatus == 0) {
|
if ($buildStatus == 0 || $buildStatus == 6) {
|
||||||
addBuildProducts($db, $build);
|
addBuildProducts($db, $build);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue