Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v2: also run 'git add -A' so that new files will actually be seen by make_makefiles. v3: also check if tools/make_makefiles itself was modified.
testbot/bin/build/Build.pl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index 051039f..82cd66a 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -74,6 +74,7 @@ sub ApplyPatch($$$) { my ($PatchFile, $PatchType, $BaseName) = @_;
+ my $NeedMakeMakefiles = !1; my $NeedMakefile = 0; my $NeedMakeInclude = !1; my $NeedBuildDeps = !1; @@ -84,7 +85,7 @@ sub ApplyPatch($$$) { my $Line; while (defined($Line = <FH>) && - ($NeedMakefile == 0 || ! $NeedMakeInclude || ! $NeedBuildDeps || + (! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || ! $NeedBuildDeps || ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure)) { if ($Line =~ m=^diff.*(?:tests/Makefile.in|Make.vars.in|Make.rules.in|Maketest.rules.in)$=) @@ -111,13 +112,19 @@ sub ApplyPatch($$$) { $NeedConfigure = 1; } + elsif ($Line =~ m=^new file= || $Line =~ m=^deleted file= || $Line =~ m=^rename= || + $Line =~ m=diff.*tools/make_makefiles=) + { + $NeedMakeMakefiles = $NeedConfigure = 1; + } } close FH; }
InfoMsg "Applying patch\n"; system("( cd $DataDir/wine && set -x && " . - " git apply --verbose $PatchFile " . + " git apply --verbose $PatchFile && " . + " git add -A " . ") >> $LogDir/Build.log 2>&1"); if ($? != 0) { @@ -125,6 +132,19 @@ sub ApplyPatch($$$) return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); }
+ if ($NeedMakeMakefiles) + { + InfoMsg "Running make_makefiles\n"; + system("( cd $DataDir/wine && set -x && " . + " ./tools/make_makefiles " . + ") >> $LogDir/Build.log 2>&1"); + if ($? != 0) + { + LogMsg "make_makefiles failed\n"; + return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); + } + } + if ($NeedAutoconf && ! $NeedConfigure) { InfoMsg "Running autoconf\n";
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- testbot/bin/build/Build.pl | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index 82cd66a..0261433 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -70,10 +70,30 @@ sub FatalError(@) exit 1; }
+sub BuildNative() +{ + mkdir "$DataDir/build-native" if (! -d "$DataDir/build-native"); + system("( cd $DataDir/build-native && set -x && " . + " rm -rf * && " . + " time ../wine/configure --enable-win64 --without-x --without-freetype && " . + " time make -j$ncpus depend && " . + " time make -j$ncpus __tooldeps__ " . + ") >>$LogDir/Build.log 2>&1"); + + if ($? != 0) + { + LogMsg "Build native failed\n"; + return !1; + } + + return 1; +} + sub ApplyPatch($$$) { my ($PatchFile, $PatchType, $BaseName) = @_;
+ my $NeedBuildNative = !1; my $NeedMakeMakefiles = !1; my $NeedMakefile = 0; my $NeedMakeInclude = !1; @@ -85,8 +105,8 @@ sub ApplyPatch($$$) { my $Line; while (defined($Line = <FH>) && - (! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || ! $NeedBuildDeps || - ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure)) + (! $NeedBuildNative || ! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || + ! $NeedBuildDeps || ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure)) { if ($Line =~ m=^diff.*(?:tests/Makefile.in|Make.vars.in|Make.rules.in|Maketest.rules.in)$=) { @@ -117,6 +137,14 @@ sub ApplyPatch($$$) { $NeedMakeMakefiles = $NeedConfigure = 1; } + elsif ($Line =~ m=^diff.*tools/makedep.c=) + { + $NeedBuildNative = $NeedMakeMakefiles = $NeedConfigure = 1; + } + elsif ($Line =~ m=^diff.*tools/(?:winebuild|wrc)=) + { + $NeedBuildNative = 1; + } } close FH; } @@ -132,6 +160,15 @@ sub ApplyPatch($$$) return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); }
+ if ($NeedBuildNative) + { + InfoMsg "Building tools\n"; + if (!BuildNative()) + { + return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); + } + } + if ($NeedMakeMakefiles) { InfoMsg "Running make_makefiles\n";
Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
BuildNative() was declared too early and was failing because it could not use the $ncpus global variable (I know global variables are bad).
I just moved it down a little and with that change it works great. So I'm submitting the modified form to be applied after the [Tools v2 1/2] patch.
Note: I hope I'm resending the patch correctly. Given the change is minor I think Zebediah should still be considered the author (hence the
From line) but I removed the Signed-off-by line. My understanding is he
can sign-off on the modified version if so desired.
testbot/bin/build/Build.pl | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index 82cd66af..96cf7414 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -74,6 +74,7 @@ sub ApplyPatch($$$) { my ($PatchFile, $PatchType, $BaseName) = @_;
+ my $NeedBuildNative = !1; my $NeedMakeMakefiles = !1; my $NeedMakefile = 0; my $NeedMakeInclude = !1; @@ -85,8 +86,8 @@ sub ApplyPatch($$$) { my $Line; while (defined($Line = <FH>) && - (! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || ! $NeedBuildDeps || - ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure)) + (! $NeedBuildNative || ! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || + ! $NeedBuildDeps || ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure)) { if ($Line =~ m=^diff.*(?:tests/Makefile.in|Make.vars.in|Make.rules.in|Maketest.rules.in)$=) { @@ -117,6 +118,14 @@ sub ApplyPatch($$$) { $NeedMakeMakefiles = $NeedConfigure = 1; } + elsif ($Line =~ m=^diff.*tools/makedep.c=) + { + $NeedBuildNative = $NeedMakeMakefiles = $NeedConfigure = 1; + } + elsif ($Line =~ m=^diff.*tools/(?:winebuild|wrc)=) + { + $NeedBuildNative = 1; + } } close FH; } @@ -132,6 +141,15 @@ sub ApplyPatch($$$) return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); }
+ if ($NeedBuildNative) + { + InfoMsg "Building tools\n"; + if (!BuildNative()) + { + return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); + } + } + if ($NeedMakeMakefiles) { InfoMsg "Running make_makefiles\n"; @@ -190,6 +208,25 @@ sub CountCPUs() $ncpus ||= 1; }
+sub BuildNative() +{ + mkdir "$DataDir/build-native" if (! -d "$DataDir/build-native"); + system("( cd $DataDir/build-native && set -x && " . + " rm -rf * && " . + " time ../wine/configure --enable-win64 --without-x --without-freetype && " . + " time make -j$ncpus depend && " . + " time make -j$ncpus __tooldeps__ " . + ") >>$LogDir/Build.log 2>&1"); + + if ($? != 0) + { + LogMsg "Build native failed\n"; + return !1; + } + + return 1; +} + sub BuildTestExecutable($$$$$$$$) { my ($BaseName, $PatchType, $Bits, $NeedConfigure, $NeedMakefile,
Thanks for the fix... obviously I don't have a way to test these changes (or a good enough familiarity with the code to not make these errors).
Signed-off-by: Zebediah Figura z.figura12@gmail.com
On 12/13/2017 10:43 AM, Zebediah Figura wrote:
Signed-off-by: Francois Gouget fgouget@codeweavers.com
BuildNative() was declared too early and was failing because it could not use the $ncpus global variable (I know global variables are bad).
I just moved it down a little and with that change it works great. So I'm submitting the modified form to be applied after the [Tools v2 1/2] patch.
Note: I hope I'm resending the patch correctly. Given the change is minor I think Zebediah should still be considered the author (hence the From line) but I removed the Signed-off-by line. My understanding is he can sign-off on the modified version if so desired.
testbot/bin/build/Build.pl | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index 82cd66af..96cf7414 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -74,6 +74,7 @@ sub ApplyPatch($$$) { my ($PatchFile, $PatchType, $BaseName) = @_;
- my $NeedBuildNative = !1; my $NeedMakeMakefiles = !1; my $NeedMakefile = 0; my $NeedMakeInclude = !1;
@@ -85,8 +86,8 @@ sub ApplyPatch($$$) { my $Line; while (defined($Line = <FH>) &&
(! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude || ! $NeedBuildDeps ||
! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure))
(! $NeedBuildNative || ! $NeedMakeMakefiles || $NeedMakefile == 0 || ! $NeedMakeInclude ||
{ if ($Line =~ m=^diff.*(?:tests/Makefile.in|Make.vars.in|Make.rules.in|Maketest.rules.in)$=) {! $NeedBuildDeps || ! $NeedImplib || ! $NeedAutoconf || ! $NeedConfigure))
@@ -117,6 +118,14 @@ sub ApplyPatch($$$) { $NeedMakeMakefiles = $NeedConfigure = 1; }
elsif ($Line =~ m=^diff.*tools/makedep.c=)
{
$NeedBuildNative = $NeedMakeMakefiles = $NeedConfigure = 1;
}
elsif ($Line =~ m=^diff.*tools/(?:winebuild|wrc)=)
{
$NeedBuildNative = 1;
} close FH; }}
@@ -132,6 +141,15 @@ sub ApplyPatch($$$) return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure); }
- if ($NeedBuildNative)
- {
- InfoMsg "Building tools\n";
- if (!BuildNative())
- {
return (-1, $NeedMakeInclude, $NeedBuildDeps, $NeedImplib, $NeedConfigure);
- }
- }
- if ($NeedMakeMakefiles) { InfoMsg "Running make_makefiles\n";
@@ -190,6 +208,25 @@ sub CountCPUs() $ncpus ||= 1; }
+sub BuildNative() +{
- mkdir "$DataDir/build-native" if (! -d "$DataDir/build-native");
- system("( cd $DataDir/build-native && set -x && " .
" rm -rf * && " .
" time ../wine/configure --enable-win64 --without-x --without-freetype && " .
" time make -j$ncpus depend && " .
" time make -j$ncpus __tooldeps__ " .
") >>$LogDir/Build.log 2>&1");
- if ($? != 0)
- {
- LogMsg "Build native failed\n";
- return !1;
- }
- return 1;
+}
sub BuildTestExecutable($$$$$$$$) { my ($BaseName, $PatchType, $Bits, $NeedConfigure, $NeedMakefile,