Changeset 208045 in webkit


Ignore:
Timestamp:
Oct 28, 2016 5:36:33 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
https://bugs.webkit.org/show_bug.cgi?id=164054

Patch by Fujii Hironori <Fujii Hironori> on 2016-10-28
Reviewed by Michael Catanzaro.

generate-bindings-all.pl determines which IDL to recompile by
comparing timestamps of generated files, source IDL and its
dependencies. But this is not enough. If a new supplemental IDL
is added, its supplemented IDL needs to be recompiled even though
the timestamp of the supplemental IDL is older than the
generated files.

  • bindings/scripts/generate-bindings-all.pl: Read supplemental

dependency file both before and after invoking preprocess-idls.pl.
Recompile IDL files if its supplemental dependencies are added or
removed.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208043 r208045  
     12016-10-28  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
     4        https://bugs.webkit.org/show_bug.cgi?id=164054
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        generate-bindings-all.pl determines which IDL to recompile by
     9        comparing timestamps of generated files, source IDL and its
     10        dependencies.  But this is not enough. If a new supplemental IDL
     11        is added, its supplemented IDL needs to be recompiled even though
     12        the timestamp of the supplemental IDL is older than the
     13        generated files.
     14
     15        * bindings/scripts/generate-bindings-all.pl: Read supplemental
     16        dependency file both before and after invoking preprocess-idls.pl.
     17        Recompile IDL files if its supplemental dependencies are added or
     18        removed.
     19
    1202016-10-28  Youenn Fablet  <youenn@apple.com>
    221
  • trunk/Source/WebCore/bindings/scripts/generate-bindings-all.pl

    r207617 r208045  
    7171close($fh) or die;
    7272
    73 my %supplementedIdlFiles;
     73my %oldSupplements;
     74my %newSupplements;
    7475if ($supplementalDependencyFile) {
    7576    my @output = ($supplementalDependencyFile, @ppExtraOutput);
    76     my @deps = (@idlFiles, @generatorDependency);
     77    my @deps = ($idlFilesList, @idlFiles, @generatorDependency);
    7778    if (needsUpdate(\@output, \@deps)) {
     79        readSupplementalDependencyFile($supplementalDependencyFile, \%oldSupplements) if -e $supplementalDependencyFile;
    7880        my @args = (File::Spec->catfile($scriptDir, 'preprocess-idls.pl'),
    7981                    '--defines', $defines,
     
    8486        executeCommand($perl, @args) == 0 or die;
    8587    }
    86     open(my $fh, '<', $supplementalDependencyFile) or die "Cannot open $supplementalDependencyFile";
    87     while (<$fh>) {
    88         my ($idlFile, @followingIdlFiles) = split(/\s+/);
    89         $supplementedIdlFiles{$idlFile} = \@followingIdlFiles;
    90     }
    91     close($fh) or die;
     88    readSupplementalDependencyFile($supplementalDependencyFile, \%newSupplements);
    9289}
    9390
     
    105102buildDirectoryCache();
    106103
    107 my @idlFilesToUpdate = grep {
     104my @idlFilesToUpdate = grep &{sub {
     105    if (defined($oldSupplements{$_})
     106        && @{$oldSupplements{$_}} ne @{$newSupplements{$_} or []}) {
     107        # Re-process the IDL file if its supplemental dependencies were added or removed
     108        return 1;
     109    }
    108110    my ($filename, $dirs, $suffix) = fileparse($_, '.idl');
    109111    my $sourceFile = File::Spec->catfile($outputDirectory, "JS$filename.cpp");
     
    114116                $idlAttributesFile,
    115117                @generatorDependency,
    116                 @{$supplementedIdlFiles{$_} or []},
     118                @{$newSupplements{$_} or []},
    117119                implicitDependencies($depFile));
    118120    needsUpdate(\@output, \@deps);
    119 } @idlFiles;
     121}}, @idlFiles;
    120122my $queue = Thread::Queue->new(@idlFilesToUpdate);
    121123my $abort :shared = 0;
     
    235237    return `stty size` =~ /\d+\s+(\d+)/ ? $1 : 80;
    236238}
     239
     240sub readSupplementalDependencyFile
     241{
     242    my $filename = shift;
     243    my $supplements = shift;
     244    open(my $fh, '<', $filename) or die "Cannot open $filename";
     245    while (<$fh>) {
     246        my ($idlFile, @followingIdlFiles) = split(/\s+/);
     247        $supplements->{$idlFile} = [sort @followingIdlFiles];
     248    }
     249    close($fh) or die;
     250}
Note: See TracChangeset for help on using the changeset viewer.