diff --git a/src/root/common.tt b/src/root/common.tt
index 9977d97e..b6580e9a 100644
--- a/src/root/common.tt
+++ b/src/root/common.tt
@@ -217,6 +217,8 @@
[% ELSIF build.resultInfo.buildstatus == 5 %]
+ [% ELSIF build.resultInfo.buildstatus == 6 %]
+
[% ELSE %]
[% END %]
@@ -246,6 +248,9 @@
Build inhibited because a dependency previously failed to build
[% failedDep = build.resultInfo.failedDep %]
(namely, [% failedDep.outpath %])
+ [% ELSIF build.resultInfo.buildstatus == 6 %]
+
+ Build failed (with result)
[% ELSE %]
Build failed
diff --git a/src/script/hydra_build.pl.in b/src/script/hydra_build.pl.in
index be2562b4..66bed96b 100755
--- a/src/script/hydra_build.pl.in
+++ b/src/script/hydra_build.pl.in
@@ -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);
}