]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
cs-bisection-step: Do explicitly set runvar for suppressed recursion
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 15:56:29 +0000 (15:56 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 16:00:38 +0000 (16:00 +0000)
When we detect that we are considering a job which is identically
named to one earlier in the dependency chain, it could happen that the
final referencing runvar in the job at which we break the cycle is
actually to an unqualified job name.

(This cannot happen unless the cycle has more than 2 jobs, and
therefore more than one job name, because otherwise the job we would
be copying would have a self-reference.  So it cannot occur right
now.)

So when breaking the cycle, we should update the job we are building
to refer to the exact flight and job we want it to reuse.

The most convenient way to do this is to reorganise the new recursion
suppression code: we retain the suppressed entries in $subjobs, and
filter them as appropriate.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cs-bisection-step

index a7e033640b617ba35f1c43d0989e1a17e1e8a996..05bfaa0ac0aed5ed45ac36907ec28b3b16fff559 100755 (executable)
@@ -1214,20 +1214,17 @@ END
         }
     }
 
-    @$subjobs = grep {
-        if ($recursion_track{ $_->{job} }) {
-            print STDERR "Not recursively creating another $_->{job} (".
-                (
-                 join " -> ",
-                 map { $_->{Spec} }
-                 sort { $a->{Depth} <=> $b->{Depth} }
-                 values %recursion_track
-                ). " -> $_->{orgflight}.$_->{job}\n";
-            0;
-        } else {
-            1;
-        }
-    } @$subjobs;
+    foreach my $subjob (@$subjobs) {
+        next unless $recursion_track{ $subjob->{job} };
+        $subjob->{suppress} = 1;
+        print STDERR "Not recursively demanding another $subjob->{job} (".
+            (
+             join " -> ",
+             map { $_->{Spec} }
+             sort { $a->{Depth} <=> $b->{Depth} }
+             values %recursion_track
+            ). " -> $subjob->{orgflight}.$subjob->{job}\n";
+    }
 
     # See if there's a build we can reuse
 
@@ -1237,7 +1234,8 @@ END
 
     my $usejob;
 
-    if ($cache_option and $cacheok and $recipe =~ m/^build/ and !@$subjobs) {
+    if ($cache_option and $cacheok and $recipe =~ m/^build/
+        and !grep { !$_->{suppress} } @$subjobs) {
        my $reusejob= $builds_investigated{$popjob};
        if (!defined $reusejob) {
            print STDERR "Searching for $popjob (like $copyflight) to reuse...\n";
@@ -1309,7 +1307,13 @@ END
 END
     foreach my $subjob (@$subjobs) {
         my $target;
-        $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
+        if ($subjob->{suppress}) {
+            $target = "$subjob->{orgflight}.$subjob->{job}";
+            print STDERR "Reusing $target for $subjob->{name}".
+                " in $popflight.$popjob\n";
+        } else {
+            $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
+        }
         $jobsetq->execute($target, $popflight, $popjob, $subjob->{name});
     }
     $jobsetq->finish();