Warnings are very dependent on the compiler version. So make sure the TestBot will not break in case the pristine source triggers a compiler warning: first try with -Werror and build without it as a fallback. Compiling the patches then uses the same settings. Let the BuildWine() callers specify whether to try compiling with -Werror to accommodate both the *Reconfig.pl and regular build cases.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/build/Build.pl | 4 ++-- testbot/bin/build/Reconfig.pl | 14 ++++++++------ testbot/bin/build/WineReconfig.pl | 16 +++++++++------- testbot/bin/build/WineTest.pl | 6 +++--- testbot/lib/Build/Utils.pm | 26 ++++++++++++++++++++------ 5 files changed, 42 insertions(+), 24 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index b2c13c8924..23ab68587e 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -167,8 +167,8 @@ if ($DataDir =~ /'/) my $Impacts = ApplyPatch("wine", $PatchFile);
if (!$Impacts or - !BuildWine($TaskMissions, "no-rm", "exe32", undef, "buildtests") or - !BuildWine($TaskMissions, "no-rm", "exe64", undef, "buildtests")) + !BuildWine($TaskMissions, 0, "exe32", undef, "buildtests") or + !BuildWine($TaskMissions, 0, "exe64", undef, "buildtests")) { exit(1); } diff --git a/testbot/bin/build/Reconfig.pl b/testbot/bin/build/Reconfig.pl index dd403effa9..b72fa7304a 100755 --- a/testbot/bin/build/Reconfig.pl +++ b/testbot/bin/build/Reconfig.pl @@ -53,12 +53,13 @@ use WineTestBot::Missions;
sub UpdateWineBuilds($$) { - my ($TaskMissions, $NoRm) = @_; + my ($TaskMissions, $Flags) = @_;
+ $Flags |= $Build::Utils::TRY_WERROR; my $Configure = "--without-x --without-freetype --disable-winetest"; - return BuildWine($TaskMissions, $NoRm, "exe32", + return BuildWine($TaskMissions, $Flags, "exe32", $Configure, "buildtests") && - BuildWine($TaskMissions, $NoRm, "exe64", + BuildWine($TaskMissions, $Flags, "exe64", "$Configure --enable-win64", "buildtests"); }
@@ -67,7 +68,8 @@ sub UpdateWineBuilds($$) # Setup and command line processing #
-my ($Usage, $OptUpdate, $OptBuild, $OptNoRm, $MissionStatement); +my ($Usage, $OptUpdate, $OptBuild, $MissionStatement); +my $OptBuildFlags = $Build::Utils::FROM_SCRATCH; while (@ARGV) { my $Arg = shift @ARGV; @@ -81,7 +83,7 @@ while (@ARGV) } elsif ($Arg eq "--no-rm") { - $OptNoRm = 1; + $OptBuildFlags &= ~$Build::Utils::FROM_SCRATCH; } elsif ($Arg =~ /^(?:-?|-h|--help)$/) { @@ -180,7 +182,7 @@ exit(1) if ($OptBuild and !BuildNativeTestAgentd()); exit(1) if ($OptBuild and !BuildWindowsTestAgentd()); exit(1) if ($OptBuild and !BuildTestLauncher()); exit(1) if ($OptUpdate and !GitPull("wine")); -exit(1) if ($OptBuild and !UpdateWineBuilds($TaskMissions, $OptNoRm)); +exit(1) if ($OptBuild and !UpdateWineBuilds($TaskMissions, $OptBuildFlags));
LogMsg "ok\n"; exit; diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl index 383c6bfd57..0c64fc3d52 100755 --- a/testbot/bin/build/WineReconfig.pl +++ b/testbot/bin/build/WineReconfig.pl @@ -52,11 +52,12 @@ use WineTestBot::Utils qw(ShQuote);
sub UpdateWineBuilds($$) { - my ($TaskMissions, $NoRm) = @_; + my ($TaskMissions, $Flags) = @_;
- return BuildWine($TaskMissions, $NoRm, "win32", "") && - BuildWine($TaskMissions, $NoRm, "wow64", "--enable-win64") && - BuildWine($TaskMissions, $NoRm, "wow32", "--with-wine64=". + $Flags |= $Build::Utils::TRY_WERROR; + return BuildWine($TaskMissions, $Flags, "win32", "") && + BuildWine($TaskMissions, $Flags, "wow64", "--enable-win64") && + BuildWine($TaskMissions, $Flags, "wow32", "--with-wine64=". ShQuote("$DataDir/wine-wow64")); }
@@ -107,7 +108,8 @@ sub UpdateWinePrefixes($) # Setup and command line processing #
-my ($Usage, $OptUpdate, $OptBuild, $OptNoRm, $OptAddOns, $OptWinePrefix, $MissionStatement); +my ($Usage, $OptUpdate, $OptBuild, $OptAddOns, $OptWinePrefix, $MissionStatement); +my $OptBuildFlags = $Build::Utils::FROM_SCRATCH; while (@ARGV) { my $Arg = shift @ARGV; @@ -121,7 +123,7 @@ while (@ARGV) } elsif ($Arg eq "--no-rm") { - $OptNoRm = 1; + $OptBuildFlags &= ~$Build::Utils::FROM_SCRATCH; } elsif ($Arg eq "--addons") { @@ -234,7 +236,7 @@ exit(1) if ($OptBuild and !BuildNativeTestAgentd()); 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, $OptNoRm)); +exit(1) if ($OptBuild and !UpdateWineBuilds($TaskMissions, $OptBuildFlags)); exit(1) if ($OptWinePrefix and !UpdateWinePrefixes($TaskMissions));
LogMsg "ok\n"; diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl index 1a7507670b..84ba1cb0a2 100755 --- a/testbot/bin/build/WineTest.pl +++ b/testbot/bin/build/WineTest.pl @@ -423,9 +423,9 @@ if ($Action eq "testpatch") { $Impacts = ApplyPatch("wine", "$DataDir/staging/$FileName"); exit(1) if (!$Impacts or - !BuildWine($TaskMissions, "no-rm", "win32", undef) or - !BuildWine($TaskMissions, "no-rm", "wow64", undef) or - !BuildWine($TaskMissions, "no-rm", "wow32", undef)); + !BuildWine($TaskMissions, 0, "win32", undef) or + !BuildWine($TaskMissions, 0, "wow64", undef) or + !BuildWine($TaskMissions, 0, "wow32", undef)); } foreach my $Mission (@{$TaskMissions->{Missions}}) { diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm index 3050be1393..df236faf19 100644 --- a/testbot/lib/Build/Utils.pm +++ b/testbot/lib/Build/Utils.pm @@ -317,22 +317,36 @@ sub BuildTestLauncher() return 1; }
+our $FROM_SCRATCH = 1; +our $TRY_WERROR = 2; + sub BuildWine($$$$;$) { - my ($TaskMissions, $NoRm, $Build, $Configure, $Targets) = @_; + my ($TaskMissions, $Flags, $Build, $Configure, $Targets) = @_; $Targets ||= "";
return 1 if (!$TaskMissions->{Builds}->{$Build}); # Rebuild from scratch to make sure cruft will not accumulate - rmtree "$DataDir/wine-$Build" if (!$NoRm); + rmtree "$DataDir/wine-$Build" if ($Flags & $FROM_SCRATCH); mkdir "$DataDir/wine-$Build" if (!-d "$DataDir/wine-$Build");
InfoMsg "\nRebuilding the $Build Wine\n"; my $CPUCount = GetCPUCount(); - system("cd '$DataDir/wine-$Build' && set -x && ". - (defined $Configure ? "time ../wine/configure $Configure && " : ""). - "time make -j$CPUCount $Targets"); - if ($? != 0) + my $Rc = 1; + if (defined $Configure and ($Flags & $TRY_WERROR)) + { + $Rc = system("cd '$DataDir/wine-$Build' && set -x && ". + "time ../wine/configure $Configure --enable-werror && ". + "time make -j$CPUCount $Targets"); + LogMsg "With -Werror the $Build Wine build fails\n" if ($Rc); + } + if ($Rc) + { + $Rc = system("cd '$DataDir/wine-$Build' && set -x && ". + (defined $Configure ? "time ../wine/configure $Configure && " : ""). + "time make -j$CPUCount $Targets"); + } + if ($Rc) { LogMsg "The $Build Wine build failed\n"; return !1;