Prevent multiple builds with the same (job, outPath) tuple from being added

This happened in a pathological case in Nixpkgs: the "grub" job is
evaluated for i686-linux and x86_64-linux, but in the latter case it
returns the same derivation as in the former case.  So only one build
should be added.
This commit is contained in:
Eelco Dolstra
2012-04-02 15:56:29 +00:00
parent 9d4cb29e08
commit 2f9153c640
3 changed files with 14 additions and 3 deletions

View File

@ -124,6 +124,8 @@ sub checkJobset {
my ($jobs, $nixExprInput) = evalJobs($inputInfo, $jobset->nixexprinput, $jobset->nixexprpath);
my $evalStop = time;
my $jobOutPathMap = {};
txn_do($db, sub {
my $prevEval = getPrevJobsetEval($db, $jobset, 1);
@ -138,7 +140,7 @@ sub checkJobset {
foreach my $job (permute @{$jobs->{job}}) {
next if $job->{jobName} eq "";
print STDERR " considering job " . $project->name, ":", $jobset->name, ":", $job->{jobName} . "\n";
checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval);
checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval, $jobOutPathMap);
}
# Update the last checked times and error messages for each