the input build to be specified, as well as constraints on the inputs of the inputs build. For instance, you can require that a build has input `system = "i686-linux"'.
This is important when one binary build serves as an input to another binary build. Obviously, we shouldn't pass a build on i686-linux as an input to another on i686-darwin. Hence the necessity for constraint.
The constraint are currently quite limited. What you really want to say is that the "system" input of the other build has to match the "system" input of this build. But those require a bit more work since they introduce dependencies between inputs.
NI5BVF2VLMDA7REXTV455SUCQAYMKPKNKQSRII2SJJGG2TCX4CTAC
5GRJZZORI57MXOZPWMCEZQNBYDXJUAC4QVEO5APLECV5UFXAJHYAC
S5PV6IIMKJ7PGWIFLLXERHYF3BCP2UEGFRZEZLD6UUBLVEZXJLUAC
F2G7Z2XKW6JYJBMOIRD33RF2ATPVDA7MIXMXH3YZOTRP2PZ6KARAC
IN272KZWHENW2TCR3LWQ6OZAEESJL5S7AEL3GYLJTWHJUDE6HADAC
2GK5DOU7ODF4WBSN3QTD3WIO52VTL2LOAXKGCDEMMAQPTEO4A4HAC
TLZ2SPBRX274EUS73SUUCOFYQUXB76S3F4AOSJXDYXIMMS7JIHEAC
N22GPKYTOLZLBGTGDATQDVZ4R5APZEAOIA7L32X4UXBH4XNI7MWAC
7ZHHVD6QVZCR7OHF3OIS52DF7ZIQDIS27OXCKOGMFDO2CTIOGI5AC
3E6IP3R3JGH76PNGG7RCADV65KOV24HQXPXNLVVYIQ46AVYJRG3AC
H7CNGK4OJNRYZQGPLBGR72DULLEPFQ5UISF5J24D7IMA7SYW5LGQC
FDE3BJAPDEP3BYT5A5GEGLNXPPZLA2KTGXB4ZNYRP4LJ7IFRKYXAC
3ZCEPLNOOWRHKM75FJJVQHHYIAHXAYKFF5SEKQGVSMLRAF4NOBIAC
NLJJZVHO3UXBURL2P7VGGCVUOMKFUYT3UX5JXQU3FFFAHUGEKO3AC
M3WSK4CBBGLP5W4YXPKWDL67RS2JV6VRTF67GLFKP7Q2FBT3NC6QC
X27GNHDV5KPZ5GSH6DCAJMNCEMZLCP7M43JWF2X3O5QWXMOX273AC
GCHNNFZPCYM3BPOCU5GASALJ6ONWMEVEEGVD7KKLTWC7YQKJ5KZAC
ZVTSOVHNQNQCRF3N44RKDQSL3UM7HSLTAXICMWEE6EIA6SWJXZCQC
}
sub parseJobName {
# Parse a job specification of the form `<project>:<jobset>:<job>
# [attrs]'. The project, jobset and attrs may be omitted. The
# attrs have the form `name = "value"'.
my ($s) = @_;
our $key;
our %attrs = ();
# hm, maybe I should stop programming Perl before it's too late...
$s =~ / ^ (?: (?: ([\w\-]+) : )? ([\w\-]+) : )? ([\w\-]+) \s*
(\[ \s* (
([\w]+) (?{ $key = $^N; }) \s* = \s* \"
([\w\-]+) (?{ $attrs{$key} = $^N; }) \"
\s* )* \])? $
/x
or die "invalid job specifier `$s'";
return ($1, $2, $3, \%attrs);
}
sub attrsToSQL {
my ($attrs, $id) = @_;
my $query = "1 = 1";
foreach my $name (keys %{$attrs}) {
my $value = $attrs->{$name};
$name =~ /^[\w\-]+$/ or die;
$value =~ /^[\w\-]+$/ or die;
# !!! Yes, this is horribly injection-prone... (though
# name/value are filtered above). Should use SQL::Abstract,
# but it can't deal with subqueries. At least we should use
# placeholders.
$query .= " and exists (select 1 from buildinputs where build = $id and name = '$name' and value = '$value')";
}
return $query;
{finished => 1, project => $project->name, jobset => $jobset->name, job => $jobName, buildStatus => 0},
{join => 'resultInfo', order_by => "me.id DESC", rows => 1});
{ finished => 1, project => $projectName, jobset => $jobsetName
, job => $jobName, buildStatus => 0 },
{ join => 'resultInfo', order_by => "me.id DESC", rows => 1
, where => \ attrsToSQL($attrs, "me.id") });
sub checkJobs {
sub checkJobsetWrapped {
my ($project, $jobset) = @_;
print "considering jobset ", $jobset->name, " in ", $project->name, "\n";
eval {
checkJobset($project, $jobset);
};
if ($@) {
my $msg = $@;
print "error evaluating jobset ", $jobset->name, ": $msg";
$db->txn_do(sub {
$jobset->update({lastcheckedtime => time});
setJobsetError($jobset, $msg);
});
}
}
foreach my $jobset ($project->jobsets->all) {
print "considering jobset ", $jobset->name, " in ", $project->name, "\n";
eval {
checkJobSet($project, $jobset);
};
if ($@) {
print "error evaluating jobset ", $jobset->name, ": $@";
setJobsetError($jobset, $@);
}
}
checkJobsetWrapped($project, $_) foreach $project->jobsets->all;