# Check whether a dependency of this build has previously
# failed. If so, don't even bother to build, since it will
# fail anyway. !!! Once Nix has negative caching, this code
# can go.
my @drvDeps = split '\n', `nix-store --query --requisites --include-outputs $drvPath`;
die "cannot query dependencies of `$drvPath': $?" if $? != 0;
@drvDeps = grep { $_ =~ /.drv$/ } @drvDeps;
my @drvOutputs = split '\n', `nix-store --query --outputs @drvDeps`;
die "cannot query outputs of the dependencies of `$drvPath': $?" if $? != 0;
foreach my $dep (@drvOutputs) {
# !!! This checks more than it has to, namely
# build-time-only dependencies of dependencies (which
# don't need to be built). However, it shouldn't matter:
# if the dependency was built, then presumably *its*
# dependencies were built as well.
# !!! should disregard fixed-output derivations (?)
if (!isValidPath($dep)) {
my ($step) = $db->resultset('BuildSteps')->search(
{outPath => $dep}, {rows => 1, order_by => "stopTime DESC", type => 0, busy => 0});
if ($step && $step->status != 0) {
$buildStatus = 5;
$failedDepBuild = $step->build->id;
$failedDepStepNr = $step->stepnr;
goto done;
}
}
}