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@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;
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/build/Reconfig.pl | 1 + testbot/bin/build/WineReconfig.pl | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/testbot/bin/build/Reconfig.pl b/testbot/bin/build/Reconfig.pl index 458b5daf0f..9e1043aa10 100755 --- a/testbot/bin/build/Reconfig.pl +++ b/testbot/bin/build/Reconfig.pl @@ -152,6 +152,7 @@ if (defined $Usage) print "Where:\n"; print " --update Update Wine's source code.\n"; print " --build Update the Wine builds.\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 following\n"; print " missions are run.\n"; print " - exe32: Build the 32 bit Windows test executables.\n"; diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl index bd9ff5779f..75a21b3d2d 100755 --- a/testbot/bin/build/WineReconfig.pl +++ b/testbot/bin/build/WineReconfig.pl @@ -168,15 +168,15 @@ if (defined $Usage) } 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 "Performs all the tasks needed for the host to be ready to run Wine tests: update the Wine source and addons, and rebuild the Wine binaries.\n"; print "\n"; print "Where:\n"; 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 "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"; + print " MISSIONS Is a colon-separated list of missions. By default the following\n"; + print " missions are run.\n"; print " - win32: Build the regular 32 bit Wine.\n"; print " - wow32: Build the 32 bit WoW Wine.\n"; print " - wow64: Build the 64 bit WoW Wine.\n"; @@ -185,21 +185,20 @@ if (defined $Usage) exit 0; }
-if (! -d "$DataDir/staging" and ! mkdir "$DataDir/staging") +if ($DataDir =~ /'/) { - LogMsg "Unable to create '$DataDir/staging': $!\n"; + LogMsg "The install path contains invalid characters\n"; exit(1); } - -if ($DataDir =~ /'/) +if (! -d "$DataDir/staging" and ! mkdir "$DataDir/staging") { - LogMsg "The install path contains invalid characters\n"; + LogMsg "Unable to create '$DataDir/staging': $!\n"; exit(1); }
# -# Run the builds and/or tests +# Run the builds #
exit(1) if ($OptBuild and !BuildNativeTestAgentd());