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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105844
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-24 Kentaro Hara <haraken@chromium.org>
+
+ 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 <ericu@chromium.org>
Add full support for filesystem URLs.
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
my $hasForwardDeclarations = keys(%headerForwardDeclarations);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
}
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
}
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
foreach my $include (sort @includes) {
$contents .= "#include $include\n";
}
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
if (@depsContent) {
# Update a .dep file if the contents are changed.
$contents = join "", @depsContent;
- $codeGenerator->UpdateFileIfChanged($depsFileName, $contents);
+ $codeGenerator->UpdateFile($depsFileName, $contents);
@depsContent = ();
}
my $hasForwardDeclarations = keys(%headerForwardDeclarations) + keys(%headerForwardDeclarationsForProtocols);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContentHeader = ();
@headerContent = ();
$hasForwardDeclarations = keys(%privateHeaderForwardDeclarations) + keys(%privateHeaderForwardDeclarationsForProtocols);
$contents .= "\n" if $hasForwardDeclarations;
$contents .= join "", @privateHeaderContent;
- $codeGenerator->UpdateFileIfChanged($privateHeaderFileName, $contents);
+ $codeGenerator->UpdateFile($privateHeaderFileName, $contents);
@privateHeaderContentHeader = ();
@privateHeaderContent = ();
$contents = join "", @implContentHeader;
map { $contents .= "#import \"$_\"\n" } sort keys(%implIncludes);
$contents .= join "", @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
@implContentHeader = ();
@implContent = ();
if (@internalHeaderContent > 0) {
$contents = join "", @internalHeaderContent;
- $codeGenerator->UpdateFileIfChanged($internalHeaderFileName, $contents);
+ $codeGenerator->UpdateFile($internalHeaderFileName, $contents);
@internalHeaderContent = ();
}
# Write dependency file.
if (@depsContent) {
$contents = join "", @depsContent;
- $codeGenerator->UpdateFileIfChanged($depsFileName, $contents);
+ $codeGenerator->UpdateFile($depsFileName, $contents);
@depsContent = ();
}
$contents .= "\n";
$contents .= join "", @implContentDecls, @implContent;
- $codeGenerator->UpdateFileIfChanged($implFileName, $contents);
+ $codeGenerator->UpdateFile($implFileName, $contents);
%implIncludes = ();
@implFixedHeader = ();
# Update a .h file if the contents are changed.
$contents = join "", @headerContent;
- $codeGenerator->UpdateFileIfChanged($headerFileName, $contents);
+ $codeGenerator->UpdateFile($headerFileName, $contents);
@headerContent = ();
}