Francois Gouget : testbot: Fix patchset handling in GetPatchImpacts().

Alexandre Julliard julliard at winehq.org
Mon Sep 24 12:22:58 CDT 2018


Module: tools
Branch: master
Commit: 09a1b2332d5092ec635108c6c48814707d67d52d
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=09a1b2332d5092ec635108c6c48814707d67d52d

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Sep 24 12:42:22 2018 +0200

testbot: Fix patchset handling in GetPatchImpacts().

Only the last part must be taken into account to determine if a rebuild
or testing is needed. But they are needed, the previous parts must be
taken into account for the rebuild, including the Autoconf and
MakeMakefile fields.
This also means the scope of the rebuild may be different from that of
the tests (we may need a full rebuild to run a single test). So
introduce RebuildRoot and RebuildModules which are similar to
PatchedRoot and PatchedModules but also take into account patches from
previous parts.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/PatchUtils.pm | 44 ++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 19 deletions(-)

diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index 2bac7be..b7307e5 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -283,24 +283,12 @@ sub GetPatchImpacts($;$)
 
   if ($PastImpacts)
   {
-    if ($PastImpacts->{PatchedRoot} or $PastImpacts->{PatchedModules} or
-        $PastImpacts->{PatchedTests})
-    {
-      # Update the list of Wine files so we correctly recognize patchset parts
-      # that modify new Wine files.
-      my $WineFiles = $PastImpacts->{WineFiles} || $_WineFiles;
-      map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$WineFiles};
-      map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$PastImpacts->{NewFiles}};
-      map { delete $Impacts->{WineFiles}->{$_} } keys %{$PastImpacts->{DeletedFiles}};
-      # Modules impacted by previous parts of a patchset still need to be
-      # rebuilt.
-      $Impacts->{BuildModules} = { %{$PastImpacts->{BuildModules}} };
-    }
-    else
-    {
-      $Impacts->{NewFiles} = $PastImpacts->{NewFiles};
-      $Impacts->{DeletedFiles} = $PastImpacts->{DeletedFiles};
-    }
+    # Update the list of Wine files so we correctly recognize patchset parts
+    # that modify new Wine files.
+    my $WineFiles = $PastImpacts->{WineFiles} || $_WineFiles;
+    map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$WineFiles};
+    map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$PastImpacts->{NewFiles}};
+    map { delete $Impacts->{WineFiles}->{$_} } keys %{$PastImpacts->{DeletedFiles}};
 
     foreach my $PastInfo (values %{$PastImpacts->{Tests}})
     {
@@ -403,6 +391,24 @@ sub GetPatchImpacts($;$)
     $Impacts->{TestUnitCount} += $TestInfo->{UnitCount};
   }
 
+  if ($Impacts->{PatchedRoot} or $Impacts->{PatchedModules} or
+      $Impacts->{PatchedTests})
+  {
+    # Any patched area will need to be rebuilt...
+    $Impacts->{RebuildRoot} = $Impacts->{PatchedRoot};
+    $Impacts->{RebuildModules} = $Impacts->{PatchedModules};
+
+    # ... even if the patch was in previous parts
+    if ($PastImpacts)
+    {
+      $Impacts->{Autoconf} ||= $PastImpacts->{Autoconf};
+      $Impacts->{MakeMakefiles} ||= $PastImpacts->{MakeMakefiles};
+      $Impacts->{RebuildRoot} ||= $PastImpacts->{PatchedRoot};
+      $Impacts->{RebuildModules} ||= $PastImpacts->{PatchedModules};
+      map { $Impacts->{BuildModules}->{$_} = 1 } keys %{$PastImpacts->{BuildModules}};
+    }
+  }
+
   return $Impacts;
 }
 
@@ -419,7 +425,7 @@ sub GetBuildTimeout($$)
   map {$_ =~ /^exe/ ? $ExeCount++ : $WineCount++ } keys %$Builds;
 
   # Set $ModuleCount to 0 if a full rebuild is needed
-  my $ModuleCount = (!$Impacts or $Impacts->{PatchedRoot}) ? 0 :
+  my $ModuleCount = (!$Impacts or $Impacts->{RebuildRoot}) ? 0 :
                     scalar(keys %{$Impacts->{BuildModules}});
 
   my ($ExeTimeout, $WineTimeout) = (0, 0);




More information about the wine-cvs mailing list