- Revision
- 105844
- Author
- [email protected]
- Date
- 2012-01-24 18:47:06 -0800 (Tue, 24 Jan 2012)
Log Message
Invalidate r105697, r105766, r105809 and r105805
https://bugs.webkit.org/show_bug.cgi?id=76970
Reviewed by Adam Barth.
I've been trying to stop rebuilding .h/.cpp files generated by
unchanged IDLs (bug 76836), but the approach was wrong.
This patch invalidates patches committed in r105697, r105766,
r105809 and r105805.
In r105697, r105766, r105809 and r105805, I modified CodeGenerator*.pm
so that they overwrite .h/.cpp files only when the bytes differ.
By this fix, we were able to stop rebuilding .h/.cpp files that are not
changed. However, the fix has made generate-bindings.pl run for almost
all IDLs every time. The reason is as follows:
(0) Assume that there are A.idl, B.idl and C.idl.
(1) Modify A.idl.
(2) First build.
(3) supplemental_dependency.tmp is updated.
(4) generate-bindings.pl runs for A.idl, B.idl and C.idl.
(5) A.h and A.cpp are updated. B.h, B.cpp, C.h and C.cpp are not updated.
(6) Second build.
(7) Since B.h, B.cpp, C.h and C.cpp are older than supplemental_dependency.tmp, generate-bindings.pl runs for B.idl and C.idl.
(8) B.h, B.cpp, C.h and C.cpp are not updated.
(9) Third build.
(10) Since B.h, B.cpp, C.h and C.cpp are older than supplemental_dependency.tmp, generate-bindings.pl runs for B.idl and C.idl.
(11) B.h, B.cpp, C.h and C.cpp are not updated.
...
We should fix the bug somehow, but how to fix it is not obvious.
For the time being, this patch invalidates r105697, r105766, r105809
and r105805.
No tests. No change in behavior.
* bindings/scripts/CodeGenerator.pm:
(UpdateFile):
* bindings/scripts/CodeGeneratorCPP.pm:
(WriteData):
* bindings/scripts/CodeGeneratorJS.pm:
(WriteData):
* bindings/scripts/CodeGeneratorObjC.pm:
(WriteData):
* bindings/scripts/CodeGeneratorV8.pm:
(WriteData):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (105843 => 105844)
--- trunk/Source/WebCore/ChangeLog 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/ChangeLog 2012-01-25 02:47:06 UTC (rev 105844)
@@ -1,3 +1,55 @@
+2012-01-24 Kentaro Hara <[email protected]>
+
+ Invalidate r105697, r105766, r105809 and r105805
+ https://bugs.webkit.org/show_bug.cgi?id=76970
+
+ Reviewed by Adam Barth.
+
+ I've been trying to stop rebuilding .h/.cpp files generated by
+ unchanged IDLs (bug 76836), but the approach was wrong.
+ This patch invalidates patches committed in r105697, r105766,
+ r105809 and r105805.
+
+ In r105697, r105766, r105809 and r105805, I modified CodeGenerator*.pm
+ so that they overwrite .h/.cpp files only when the bytes differ.
+ By this fix, we were able to stop rebuilding .h/.cpp files that are not
+ changed. However, the fix has made generate-bindings.pl run for almost
+ all IDLs every time. The reason is as follows:
+
+ (0) Assume that there are A.idl, B.idl and C.idl.
+
+ (1) Modify A.idl.
+ (2) First build.
+ (3) supplemental_dependency.tmp is updated.
+ (4) generate-bindings.pl runs for A.idl, B.idl and C.idl.
+ (5) A.h and A.cpp are updated. B.h, B.cpp, C.h and C.cpp are not updated.
+
+ (6) Second build.
+ (7) Since B.h, B.cpp, C.h and C.cpp are older than supplemental_dependency.tmp, generate-bindings.pl runs for B.idl and C.idl.
+ (8) B.h, B.cpp, C.h and C.cpp are not updated.
+
+ (9) Third build.
+ (10) Since B.h, B.cpp, C.h and C.cpp are older than supplemental_dependency.tmp, generate-bindings.pl runs for B.idl and C.idl.
+ (11) B.h, B.cpp, C.h and C.cpp are not updated.
+ ...
+
+ We should fix the bug somehow, but how to fix it is not obvious.
+ For the time being, this patch invalidates r105697, r105766, r105809
+ and r105805.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (UpdateFile):
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ (WriteData):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (WriteData):
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ (WriteData):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (WriteData):
+
2012-01-24 Eric Uhrhane <[email protected]>
Add full support for filesystem URLs.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (105843 => 105844)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-01-25 02:47:06 UTC (rev 105844)
@@ -161,28 +161,15 @@
return $codeGenerator->FileNamePrefix();
}
-sub UpdateFileIfChanged
+sub UpdateFile
{
my $object = shift;
my $fileName = shift;
my $contents = shift;
- my $shouldUpdate = 0;
-
- if (open FH, $fileName) {
- local $/ = undef;
- my $oldContents = <FH>;
- $shouldUpdate = 1 if $oldContents ne $contents;
- close FH;
- } else {
- $shouldUpdate = 1;
- }
-
- if ($shouldUpdate) {
- open FH, "> $fileName" or die "Couldn't open $fileName: $!\n";
- print FH $contents;
- close FH;
- }
+ open FH, "> $fileName" or die "Couldn't open $fileName: $!\n";
+ print FH $contents;
+ close FH;
}
sub ForAllParents
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm (105843 => 105844)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-01-25 02:47:06 UTC (rev 105844)
@@ -952,7 +952,7 @@
my $hasForwardDeclarations = keys(%headerForwardDeclarations);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
@@ -968,7 +968,7 @@
}
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (105843 => 105844)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-01-25 02:47:06 UTC (rev 105844)
@@ -3265,7 +3265,7 @@
}
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
@@ -3293,7 +3293,7 @@
foreach my $include (sort @includes) {
$contents .= "#include $include\n";
}
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
@@ -3303,7 +3303,7 @@
if (@depsContent) {
# Update a .dep file if the contents are changed.
$contents = join "", @depsContent;
- $codeGenerator->UpdateFileIfChanged($depsFileName, $contents);
+ $codeGenerator->UpdateFile($depsFileName, $contents);
@depsContent = ();
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (105843 => 105844)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2012-01-25 02:47:06 UTC (rev 105844)
@@ -1779,7 +1779,7 @@
my $hasForwardDeclarations = keys(%headerForwardDeclarations) + keys(%headerForwardDeclarationsForProtocols);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
@@ -1794,7 +1794,7 @@
$hasForwardDeclarations = keys(%privateHeaderForwardDeclarations) + keys(%privateHeaderForwardDeclarationsForProtocols);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @privateHeaderContent;
- $codeGenerator->UpdateFileIfChanged($privateHeaderFileName, $contents);
+ $codeGenerator->UpdateFile($privateHeaderFileName, $contents);
@privateHeaderContentHeader = ();
@privateHeaderContent = ();
@@ -1807,7 +1807,7 @@
$contents = join "", @implContentHeader;
map { $contents .= "#import \"$_\"\n" } sort keys(%implIncludes);
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
@@ -1816,7 +1816,7 @@
if (@internalHeaderContent > 0) {
$contents = join "", @internalHeaderContent;
- $codeGenerator->UpdateFileIfChanged($internalHeaderFileName, $contents);
+ $codeGenerator->UpdateFile($internalHeaderFileName, $contents);
@internalHeaderContent = ();
}
@@ -1824,7 +1824,7 @@
# Write dependency file.
if (@depsContent) {
$contents = join "", @depsContent;
- $codeGenerator->UpdateFileIfChanged($depsFileName, $contents);
+ $codeGenerator->UpdateFile($depsFileName, $contents);
@depsContent = ();
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (105843 => 105844)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-01-25 02:20:00 UTC (rev 105843)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-01-25 02:47:06 UTC (rev 105844)
@@ -3835,7 +3835,7 @@
$contents .= "\n";
$contents .= join "", @implContentDecls, @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
%implIncludes = ();
@implFixedHeader = ();
@@ -3844,7 +3844,7 @@
# Update a .h file if the contents are changed.
$contents = join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContent = ();
}