All successful, non-garbage-collected builds in the evaluation are passed in a attribute set. So if you declare a Hydra input named ‘foo’ of type ‘eval’, you get a set with members ‘foo.<jobname>’. For instance, if you passed a Nixpkgs eval as an input named ‘nixpkgs’, then you could get the Firefox build for x86_64-linux as ‘nixpkgs.firefox.x86_64-linux’.
Inputs of type ‘eval’ can be specified in three ways:
As the number of the evaluation.
As a jobset identifier (‘<project>:<jobset>’), which will yield the latest finished evaluation of that jobset. Note that there is no guarantee that any job in that evaluation has succeeded, so it might not be very useful.
As a job identifier (‘<project>:<jobset>:<job>’), which will yield the latest finished evaluation of that jobset in which <job> succeeded. In conjunction with aggregate jobs, this allows you to make sure that the evaluation contains the desired builds.
Z52T2BC4CTXQGBXPW4VZF5A5W67KDJ65RUBCM7MWHUNPMI6XLQCQC
PHNLYPKB5SJJAHAICS6QEMRNCREPG7SC2MQRLTQMQLWGXM427S3QC
PGSSRA7CPOQI354Y6YJTYRFF57YJARB5THFE3MBJBVHOLYNEIGTQC
ZFEN2MAOJRRQEIORSK2N6PNAWGBEN2WNAWA6IWUVOHP5I5PQC6JAC
OOQ2D3KCLFPYNAN253PHWLBQMB6OMO2KYQWQXLTP65SQAYZWQ5LAC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
TQVKZQUGCFYNH5P56LXMXRXZNTD56MH5T5GX2BMQ5YSRPGHAUYMAC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
UXXFND4UYVY6WHWPRL3YIRKWTGFM3PR32JZCYKYNQOX7MZAFEG5AC
LMETCA7G76HUDV2ZVOOIH6TI6UG7RJ5VCZNWRAAZVIQOWG6XLX5QC
HQGXL4MXGHICQ3IRRQUR6KQHS2RKVOTDKQ5ZETXHQ56DANR2YADQC
U4TD3AIQXBJFFUORTMIC4IHZTVBORRKL2TZ2FSP4G665ECZOEMNAC
JAH3UPWAVSHXIPNGL6PROQPZBYZHPJNFONWBDZX4HCX646USZXUQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
KQS7DSKJHTEHALCPTXMWRX2IBOVC5BWU7RWJ4GP5A2JJSBR7HPKAC
4FWDVNWAUAFDXPXIOBOVM2ZRPZG4LLE4JBKYIXUKR45YN6MEOMXQC
JTRG7RDQXKPSO4ESGDLSVAT5WIFGKDL424MN6YYCVTKCOR2FTXRQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
error($c, "The value ‘$value’ of input ‘$name’ does not specify a Hydra evaluation. "
. "It should be either the number of a specific evaluation, the name of "
. "a jobset (given as <project>:<jobset>), or the name of a job (<project>:<jobset>:<job>).")
if $type eq "eval" && $value !~ /^\d+$/
&& $value !~ /^$projectNameRE:$jobsetNameRE$/
&& $value !~ /^$projectNameRE:$jobsetNameRE:$jobNameRE$/;
if ($value =~ /^\d+$/) {
$eval = $db->resultset('JobsetEvals')->find({ id => int($value) });
die "evaluation $eval->{id} does not exist\n" unless defined $eval;
} elsif ($value =~ /^($projectNameRE):($jobsetNameRE)$/) {
my $jobset = $db->resultset('Jobsets')->find({ project => $1, name => $2 });
die "jobset ‘$value’ does not exist\n" unless defined $jobset;
$eval = getLatestFinishedEval($jobset);
die "jobset ‘$value’ does not have a finished evaluation\n" unless defined $eval;
} elsif ($value =~ /^($projectNameRE):($jobsetNameRE):($jobNameRE)$/) {
$eval = $db->resultset('JobsetEvals')->find(
{ project => $1, jobset => $2, hasnewbuilds => 1 },
{ order_by => "id DESC", rows => 1
, where =>
\ [ # All builds in this jobset should be finished...
"not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0) "
# ...and the specified build must have succeeded.
. "and exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.job = ? and b.buildstatus = 0)"
, [ 'name', $3 ] ]
});
die "there is no successful build of ‘$value’ in a finished evaluation\n" unless defined $eval;
} else {
die;
}
my $jobs = {};
foreach my $build ($eval->builds) {
next unless $build->finished == 1 && $build->buildstatus == 0;
# FIXME: Handle multiple outputs.
my $out = $build->buildoutputs->find({ name => "out" });
next unless defined $out;
# FIXME: Should we fail if the path is not valid?
next unless isValidPath($out->path);
$jobs->{$build->get_column('job')} = $out->path;
}
return { jobs => $jobs };
}
}
when ("eval") {
die "input type ‘eval’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";
my $s = "{ ";
# FIXME: escape $_. But dots should not be escaped.
$s .= "$_ = builtins.storePath ${\$alt->{jobs}->{$_}}; "
foreach keys %{$alt->{jobs}};
$s .= "}";
push @res, "--arg", $input, $s;