Title: [105603] trunk/Tools
- Revision
- 105603
- Author
- [email protected]
- Date
- 2012-01-23 02:14:48 -0800 (Mon, 23 Jan 2012)
Log Message
[Qt] Change how build-webkit decides when to do full incremental builds
Instead of relying on update-webkit (which isn't run on the bots) to
decide when to do a full incremental build (make qmake), we let the
build-webkit script itself check the current SVN revision against the
previous build (by storing it in .webkit.config).
If the two differ we assume a full incremental build is needed, since
the new revisions might have introduced problematic things like new
Q_OBJECT macros. If not, we assume the developer is doing changes
locally, and revert to doing a plain 'make'.
In addition, when the build fails in the latter case, we inform the
developer of possible pitfalls and how to manually run 'make qmake'.
Reviewed by Ossy.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (105602 => 105603)
--- trunk/Tools/ChangeLog 2012-01-23 10:09:47 UTC (rev 105602)
+++ trunk/Tools/ChangeLog 2012-01-23 10:14:48 UTC (rev 105603)
@@ -1,3 +1,26 @@
+2012-01-20 Tor Arne Vestbø <[email protected]>
+
+ [Qt] Change how build-webkit decides when to do full incremental builds
+
+ Instead of relying on update-webkit (which isn't run on the bots) to
+ decide when to do a full incremental build (make qmake), we let the
+ build-webkit script itself check the current SVN revision against the
+ previous build (by storing it in .webkit.config).
+
+ If the two differ we assume a full incremental build is needed, since
+ the new revisions might have introduced problematic things like new
+ Q_OBJECT macros. If not, we assume the developer is doing changes
+ locally, and revert to doing a plain 'make'.
+
+ In addition, when the build fails in the latter case, we inform the
+ developer of possible pitfalls and how to manually run 'make qmake'.
+
+ Reviewed by Ossy.
+
+ * Scripts/update-webkit:
+ * Scripts/webkitdirs.pm:
+ (buildQMakeProjects):
+
2012-01-23 Mario Sanchez Prada <[email protected]>
[GTK] run-gtk-tests randomly fails while running the xprop comand
Modified: trunk/Tools/Scripts/update-webkit (105602 => 105603)
--- trunk/Tools/Scripts/update-webkit 2012-01-23 10:09:47 UTC (rev 105602)
+++ trunk/Tools/Scripts/update-webkit 2012-01-23 10:14:48 UTC (rev 105603)
@@ -83,8 +83,6 @@
my $startTime = time();
-my $initialRevision = currentSVNRevision();
-
my @svnOptions = ();
push @svnOptions, '-q' if $quiet;
@@ -95,9 +93,6 @@
runSvnUpdate() if isSVN();
runGitUpdate() if isGit();
-# The update might have given us a new revision
-determineCurrentSVNRevision();
-
if (-d "../Internal") {
chdir("../Internal");
print "Updating Internal\n" unless $quiet;
@@ -121,13 +116,6 @@
# WinCairo shares the auxiliary libs from the Apple port.
system("perl", "Tools/Scripts/update-webkit-wincairo-libs") == 0 or die;
}
-} elsif (isQt()) {
- if (currentSVNRevision() ne $initialRevision) {
- my $hintFile = File::Spec->catfile(sourceDir(), "Tools", "qmake", ".build-hint");
- open(HINTFILE, ">$hintFile") || die("Could not open $hintFile for writing!\n");
- print HINTFILE "incremental\n";
- close(HINTFILE);
- }
}
setupAppleWinEnv() if isAppleWinWebKit();
Modified: trunk/Tools/Scripts/webkitdirs.pm (105602 => 105603)
--- trunk/Tools/Scripts/webkitdirs.pm 2012-01-23 10:09:47 UTC (rev 105602)
+++ trunk/Tools/Scripts/webkitdirs.pm 2012-01-23 10:14:48 UTC (rev 105603)
@@ -2070,54 +2070,65 @@
my %defines = qtFeatureDefaults(\@buildArgs);
- my $pathToBuildHint = File::Spec->catfile(sourceDir(), "Tools", "qmake", ".build-hint");
+ my $svnRevision = currentSVNRevision();
+
my $buildHint = "";
- if (-e $pathToBuildHint && open(BUILDHINT, $pathToBuildHint)) {
- chomp($buildHint = <BUILDHINT>);
- close(BUILDHINT);
- }
- my $needsCleanBuild = 0;
-
my $pathToDefinesCache = File::Spec->catfile($dir, ".webkit.config");
my $pathToOldDefinesFile = File::Spec->catfile($dir, "defaults.txt");
# Ease transition to new build layout
if (-e $pathToOldDefinesFile) {
print "Old build layout detected";
- $needsCleanBuild = 1;
+ $buildHint = "clean";
} elsif (-e $pathToDefinesCache && open(DEFAULTS, $pathToDefinesCache)) {
my %previousDefines;
while (<DEFAULTS>) {
- if ($_ =~ m/(\S+?)=(\S+?)/gi) {
+ if ($_ =~ m/(\S+)=(\S+)/gi) {
$previousDefines{$1} = $2;
}
}
close (DEFAULTS);
+ $previousDefines{"SVN_REVISION"} = "unknown" if not exists $previousDefines{"SVN_REVISION"};
+
+ if ($svnRevision ne $previousDefines{"SVN_REVISION"}) {
+ print "Last built revision was " . $previousDefines{"SVN_REVISION"} .
+ ", now at revision $svnRevision. Full incremental build needed.\n";
+
+ $buildHint = "incremental";
+ }
+
+ # Don't confuse the should-we-clean heuristics below
+ delete($previousDefines{"SVN_REVISION"});
+
my @uniqueDefineNames = keys %{ +{ map { $_, 1 } (keys %defines, keys %previousDefines) } };
foreach my $define (@uniqueDefineNames) {
if (! exists $previousDefines{$define}) {
print "Feature $define added";
- $needsCleanBuild = 1;
+ $buildHint = "clean";
last;
}
if (! exists $defines{$define}) {
print "Feature $define removed";
- $needsCleanBuild = 1;
+ $buildHint = "clean";
last;
}
if ($defines{$define} != $previousDefines{$define}) {
print "Feature $define changed ($previousDefines{$define} -> $defines{$define})";
- $needsCleanBuild = 1;
+ $buildHint = "clean";
last;
}
}
+ } else {
+ # Missing build cache suggests we had a broken build after a clean,
+ # so we assume we have to do an incremental build just in case.
+ $buildHint = "incremental";
}
- if ($needsCleanBuild) {
+ if ($buildHint eq "clean") {
print ", clean build needed!\n";
# FIXME: This STDIN/STDOUT check does not work on the bots. Disable until it does.
# if (! -t STDIN || ( &promptUser("Would you like to clean the build directory?", "yes") eq "yes")) {
@@ -2132,13 +2143,6 @@
#}
}
- open(DEFAULTS, ">$pathToDefinesCache");
- print DEFAULTS "# These defines were set when building WebKit last time\n";
- foreach my $key (sort keys %defines) {
- print DEFAULTS "$key=$defines{$key}\n";
- }
- close(DEFAULTS);
-
my $result = 0;
my $makefile = File::Spec->catfile($dir, "Makefile");
@@ -2160,13 +2164,9 @@
my $command = "$make $makeargs";
$command =~ s/\s+$//;
- # FIXME: Until the bots use update-webkit instead of raw SVN, we
- # need to force the build-hint to 'incremental' :(
- $buildHint = "incremental";
-
if ($clean) {
$command = "$command distclean";
- } elsif ($buildHint =~ /^incremental$/) {
+ } elsif ($buildHint eq "incremental") {
$command = "$command incremental";
}
@@ -2175,8 +2175,39 @@
chdir ".." or die;
- unlink($pathToBuildHint) || die "Could not delete $pathToBuildHint: $!" if -e $pathToBuildHint && $result eq 0;
+ if ($result eq 0) {
+ $defines{"SVN_REVISION"} = $svnRevision;
+ open(DEFAULTS, ">$pathToDefinesCache");
+ print DEFAULTS "# These defines were set when building WebKit last time\n";
+ foreach my $key (sort keys %defines) {
+ print DEFAULTS "$key=$defines{$key}\n";
+ }
+ close(DEFAULTS);
+ } elsif ($buildHint eq "" && exitStatus($result)) {
+ my $exitCode = exitStatus($result);
+ my $failMessage = <<EOF;
+===== BUILD FAILED ======
+
+The build failed with exit code $exitCode. This may have been because you
+
+ - added an #include to a source/header
+ - added a Q_OBJECT macro to a class
+ - added a new resource to a qrc file
+
+as dependencies are not automatically re-computed for local developer builds.
+You may try computing dependencies manually by running 'make qmake' in:
+
+ $dir
+
+or passing --makeargs="qmake" to build-webkit.
+
+=========================
+
+EOF
+ print "$failMessage";
+ }
+
return $result;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes