[tools 1/2] testbot/WineReconfig: Do not prepare wineprefixes in advance.

Francois Gouget fgouget at codeweavers.com
Wed Jan 6 16:29:46 CST 2021


This avoids test failures when the patch changes the initial Wine
registry. Call CleanupWinePrefixes() after successful builds to ensure
a clean transition and remove any stray wineprefix.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48671
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

Note: WineTest already has code to create any missing wineprefix. So all 
      this patch does is make sure none is created in advance.

 testbot/bin/build/WineReconfig.pl | 47 ++++++-------------------------
 1 file changed, 9 insertions(+), 38 deletions(-)

diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl
index f9f6792a5a..bd9ff5779f 100755
--- a/testbot/bin/build/WineReconfig.pl
+++ b/testbot/bin/build/WineReconfig.pl
@@ -3,7 +3,7 @@
 #
 # Updates the Wine source from Git and rebuilds it.
 #
-# Copyright 2018 Francois Gouget
+# Copyright 2018-2021 Francois Gouget
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -65,12 +65,10 @@ sub UpdateWineBuilds($$)
 # WinePrefix helpers
 #
 
-sub UpdateWinePrefixes($)
+sub CleanupWinePrefixes()
 {
-  my ($TaskMissions) = @_;
-
-  # Make sure no obsolete wineprefix is left behind in case WineReconfig
-  # is called with a different set of targets
+  # The TestBot used to prepare WinePrefixes in advance.
+  # Make sure no such obsolete wineprefix is left behind.
   foreach my $Dir (glob("'$DataDir/wineprefix-*'"))
   {
     if (basename($Dir) =~ /^(wineprefix-[a-zA-Z0-9\@_.-]+)$/) # untaint
@@ -78,27 +76,6 @@ sub UpdateWinePrefixes($)
       rmtree("$DataDir/$1");
     }
   }
-
-  # Set up brand new WinePrefixes ready for use for testing.
-  # This way we do it once instead of doing it for every test, thus saving
-  # time. Note that this requires using a different wineprefix for each
-  # mission.
-  foreach my $Mission (@{$TaskMissions->{Missions}})
-  {
-    next if ($Mission->{test} eq "build");
-
-    my $BaseName = SetupWineEnvironment($Mission);
-    InfoMsg "\nRecreating the $BaseName wineprefix\n";
-
-    # Wait for the wineprefix creation to complete so it is really done
-    # before the snapshot gets updated.
-    my $ErrMessage = CreateWinePrefix($Mission, "wait");
-    if (defined $ErrMessage)
-    {
-      LogMsg "$ErrMessage\n";
-      return 0;
-    }
-  }
   return 1;
 }
 
@@ -107,7 +84,7 @@ sub UpdateWinePrefixes($)
 # Setup and command line processing
 #
 
-my ($Usage, $OptUpdate, $OptBuild, $OptAddOns, $OptWinePrefix, $MissionStatement);
+my ($Usage, $OptUpdate, $OptBuild, $OptAddOns, $MissionStatement);
 my $OptBuildFlags = $Build::Utils::FROM_SCRATCH;
 while (@ARGV)
 {
@@ -128,10 +105,6 @@ while (@ARGV)
   {
     $OptAddOns = 1;
   }
-  elsif ($Arg eq "--wineprefix")
-  {
-    $OptWinePrefix = 1;
-  }
   elsif ($Arg =~ /^(?:-\?|-h|--help)$/)
   {
     $Usage = 0;
@@ -159,9 +132,9 @@ while (@ARGV)
 my $TaskMissions;
 if (!defined $Usage)
 {
-  if (!$OptUpdate and !$OptBuild and !$OptAddOns and !$OptWinePrefix)
+  if (!$OptUpdate and !$OptBuild and !$OptAddOns)
   {
-    $OptUpdate = $OptBuild = $OptAddOns = $OptWinePrefix = 1;
+    $OptUpdate = $OptBuild = $OptAddOns = 1;
   }
   $MissionStatement ||= "win32:wow32:wow64";
   my ($ErrMessage, $Missions) = ParseMissionStatement($MissionStatement);
@@ -193,8 +166,7 @@ if (defined $Usage)
     Error "try '$Name0 --help' for more information\n";
     exit $Usage;
   }
-  print "Usage: $Name0 [--update] [--build [--no-rm]] [--addons] [--wineprefix]\n";
-  print "                       [--help] [MISSIONS]\n";
+  print "Usage: $Name0 [--update] [--build [--no-rm]] [--addons] [--help] [MISSIONS]\n";
   print "\n";
   print "Performs all the tasks needed for the host to be ready to test new patches: update the Wine source and addons, and rebuild the Wine binaries.\n";
   print "\n";
@@ -202,7 +174,6 @@ if (defined $Usage)
   print "  --update     Update Wine's source code.\n";
   print "  --build      Update the Wine builds.\n";
   print "  --addons     Update the Gecko and Mono Wine addons.\n";
-  print "  --wineprefix Update the wineprefixes.\n";
   print "If none of the above actions is specified they are all performed.\n";
   print "  MISSIONS     Is a colon-separated list of missions. By default the\n";
   print "               following missions are run.\n";
@@ -236,7 +207,7 @@ exit(1) if ($OptBuild and !BuildTestLauncher());
 exit(1) if ($OptUpdate and !GitPull("wine"));
 exit(1) if ($OptAddOns and !UpdateAddOns());
 exit(1) if ($OptBuild and !UpdateWineBuilds($TaskMissions, $OptBuildFlags));
-exit(1) if ($OptWinePrefix and !UpdateWinePrefixes($TaskMissions));
+exit(1) if ($OptBuild and !CleanupWinePrefixes());
 
 LogMsg "ok\n";
 exit;
-- 
2.20.1




More information about the wine-devel mailing list