* Use Nix's negative caching.
[?]
Mar 26, 2009, 12:53 PM
3BKF6P72K4YGWSQD5PO6PKNM3KXGFLONB3SONKRZR4DJHH3W3PSACDependencies
- [2]
ZV23C3PQ* Disregard failing substituters. - [3]
G5A7TZVI* Don't discard old build steps when restarting a build. - [4]
NLJJZVHO* Use ->update({...}) properly. - [5]
BD3GRK4B* Get rid of "positive failures" and separate log phases. - [6]
ECBA3GQO* Make the schema class names match the case of the SQL table names. - [7]
3E6IP3R3* Add the name of the jobset to ReleaseSetJobs, otherwise we can't - [8]
CMU3YKOU* Store the release name. - [9]
AS5PAYLI - [10]
L2E6EVE2* Merged the Build and Job tables. - [11]
2T42QGZD* Register builds as GC roots so they don't get deleted. - [12]
37R34XJO* Negative caching: don't perform a build if a dependency already - [13]
7YBYT2LQ - [14]
CLJQCY2X* Store info about all the build actions and allow them to be - [15]
LQNBKF3D - [16]
K3EAQY3X* Doh. - [*]
AFTXA575* $HYDRA_DATA environment variable.
Change contents
- edit in src/script/hydra_build.pl at line 11[18.1093][4.3075]
sub getBuildLog {my ($drvPath) = @_;my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath;return -e $logPath ? $logPath : undef;} - edit in src/script/hydra_build.pl at line 41[4.3533]→[4.3484:4603](∅→∅),[4.4603]→[2.0:104](∅→∅),[2.104]→[4.93:144](∅→∅),[4.93]→[4.93:144](∅→∅),[4.144]→[4.4744:4782](∅→∅),[4.4744]→[4.4744:4782](∅→∅),[4.4782]→[4.4283:4339](∅→∅),[4.4339]→[4.4835:4971](∅→∅),[4.4835]→[4.4835:4971](∅→∅)
# 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;}}} - edit in src/script/hydra_build.pl at line 96
my $errorMsg = $4;$errorMsg = "build failed previously (cached)" if $3 eq "cached"; - replacement in src/script/hydra_build.pl at line 101
$step->update({busy => 0, status => 1, errormsg => $4, stoptime => time});$step->update({busy => 0, status => 1, errormsg => $errorMsg, stoptime => time}); - replacement in src/script/hydra_build.pl at line 104
{ stepnr => $buildStepNr++{ stepnr => ($buildSteps{$drvPathStep} = $buildStepNr++) - replacement in src/script/hydra_build.pl at line 108
, logfile => $4, logfile => getBuildLog($drvPathStep) - replacement in src/script/hydra_build.pl at line 113
, errormsg => $4, errormsg => $errorMsg - edit in src/script/hydra_build.pl at line 173[4.871]→[4.7526:7527](∅→∅),[4.5042]→[4.7526:7527](∅→∅),[4.7526]→[4.7526:7527](∅→∅),[4.7527]→[4.4350:4463](∅→∅)
my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath;$logPath = undef unless -e $logPath; - replacement in src/script/hydra_build.pl at line 188
, logfile => $logPath, logfile => getBuildLog $drvPath