Title: [139494] trunk/Source
Revision
139494
Author
t...@chromium.org
Date
2013-01-11 14:08:32 -0800 (Fri, 11 Jan 2013)

Log Message

[chromium] Don't regenerate all bindings when any idl file changes
https://bugs.webkit.org/show_bug.cgi?id=106604

Reviewed by Kentaro Hara.

Source/WebCore:

Currently, every idl file is a dependency of generating the supplemental dependency map
and generating bindings is a dependency of the map. This means that touching any idl file
causes us to regenerate all the bindings.

Change it so that generating bindings only depends on the idl files that have Supplemental= in them.
We only have 24 idl files with Supplemental (3.7% of the 638 idl files in WebCore) so modifying
any of those will cause all bindings to be regenerated.

If you add or remove a new idl file, you have to rerun gyp which will fix up any dependencies.
If you edit an existing file and add Supplemental= to it, you will now need to rerun gyp_{webkit,chromium}.
I think that's a reasonable tradeoff since it seems highly unlikely that you would adding Supplemental=
to an existing file without renaming it. The bots will always be fine because they always run
gyp after updating.

No new tests, this is a build only change.

* WebCore.gyp/WebCore.gyp: Remove <(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp, which was causing
the full rebuild. The step to generate this file is still a hard dependency so it will still be generated and
used by generate-bindings.pl. Also remove <@(webcore_test_support_idl_files). This was saying we should regenerate
all bindings if a test idl file changed. That doesn't make sense.
* WebCore.gyp/scripts/supplemental_idl_files.py: Added.
(DoMain):

Source/WebKit/chromium:

* gyp_webkit: Add Source/WebCore/WebCore.gyp/scripts to the python import search path
so we can generate idl dependencies at gyp time.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139493 => 139494)


--- trunk/Source/WebCore/ChangeLog	2013-01-11 22:05:25 UTC (rev 139493)
+++ trunk/Source/WebCore/ChangeLog	2013-01-11 22:08:32 UTC (rev 139494)
@@ -1,3 +1,33 @@
+2013-01-11  Tony Chang  <t...@chromium.org>
+
+        [chromium] Don't regenerate all bindings when any idl file changes
+        https://bugs.webkit.org/show_bug.cgi?id=106604
+
+        Reviewed by Kentaro Hara.
+
+        Currently, every idl file is a dependency of generating the supplemental dependency map
+        and generating bindings is a dependency of the map. This means that touching any idl file
+        causes us to regenerate all the bindings.
+
+        Change it so that generating bindings only depends on the idl files that have Supplemental= in them.
+        We only have 24 idl files with Supplemental (3.7% of the 638 idl files in WebCore) so modifying
+        any of those will cause all bindings to be regenerated.
+
+        If you add or remove a new idl file, you have to rerun gyp which will fix up any dependencies.
+        If you edit an existing file and add Supplemental= to it, you will now need to rerun gyp_{webkit,chromium}.
+        I think that's a reasonable tradeoff since it seems highly unlikely that you would adding Supplemental=
+        to an existing file without renaming it. The bots will always be fine because they always run
+        gyp after updating.
+
+        No new tests, this is a build only change.
+
+        * WebCore.gyp/WebCore.gyp: Remove <(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp, which was causing
+        the full rebuild. The step to generate this file is still a hard dependency so it will still be generated and
+        used by generate-bindings.pl. Also remove <@(webcore_test_support_idl_files). This was saying we should regenerate
+        all bindings if a test idl file changed. That doesn't make sense.
+        * WebCore.gyp/scripts/supplemental_idl_files.py: Added.
+        (DoMain):
+
 2013-01-11  Alexandru Chiculita  <ach...@adobe.com>
 
         Element is displayed behind a composited layer when clipping is used on a previous element

Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (139493 => 139494)


--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2013-01-11 22:05:25 UTC (rev 139493)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2013-01-11 22:08:32 UTC (rev 139494)
@@ -1165,8 +1165,7 @@
             '../bindings/scripts/IDLParser.pm',
             '../bindings/scripts/IDLAttributes.txt',
             '../bindings/scripts/preprocessor.pm',
-            '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
-            '<@(webcore_test_support_idl_files)',
+            '<!@pymod_do_main(supplemental_idl_files <@(bindings_idl_files))',
           ],
           'outputs': [
             # FIXME:  The .cpp file should be in webkit/bindings once

Added: trunk/Source/WebCore/WebCore.gyp/scripts/supplemental_idl_files.py (0 => 139494)


--- trunk/Source/WebCore/WebCore.gyp/scripts/supplemental_idl_files.py	                        (rev 0)
+++ trunk/Source/WebCore/WebCore.gyp/scripts/supplemental_idl_files.py	2013-01-11 22:08:32 UTC (rev 139494)
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""This file returns a list of all the files that have the
+Supplemental attribute."""
+
+import re
+import sys
+
+supplemental_regex = re.compile(r'\[.+Supplemental=(\w+).+\]', re.M | re.S)
+
+
+def DoMain(filenames):
+    supplemental_files = set()
+    for filename in filenames:
+        with open(filename) as f:
+            match = re.search(supplemental_regex, f.read())
+            if match:
+                supplemental_files.add(filename)
+    return '\n'.join(supplemental_files)

Modified: trunk/Source/WebKit/chromium/ChangeLog (139493 => 139494)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-11 22:05:25 UTC (rev 139493)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-11 22:08:32 UTC (rev 139494)
@@ -1,3 +1,13 @@
+2013-01-11  Tony Chang  <t...@chromium.org>
+
+        [chromium] Don't regenerate all bindings when any idl file changes
+        https://bugs.webkit.org/show_bug.cgi?id=106604
+
+        Reviewed by Kentaro Hara.
+
+        * gyp_webkit: Add Source/WebCore/WebCore.gyp/scripts to the python import search path
+        so we can generate idl dependencies at gyp time.
+
 2013-01-11  Stephen Chenney  <schen...@chromium.org>
 
         Removing Skia flags that have been disabling oprtimizations and other improvements.

Modified: trunk/Source/WebKit/chromium/gyp_webkit (139493 => 139494)


--- trunk/Source/WebKit/chromium/gyp_webkit	2013-01-11 22:05:25 UTC (rev 139493)
+++ trunk/Source/WebKit/chromium/gyp_webkit	2013-01-11 22:08:32 UTC (rev 139494)
@@ -42,8 +42,10 @@
 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
 import gyp
 
-# Add tools/grit so that pymod_do_main(grit_info ...) can find grit_info.py.
+# Add paths so that pymod_do_main(...) can import files.
 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit'))
+sys.path.insert(1, os.path.join(chrome_src, '..', '..', 'WebCore',
+  'WebCore.gyp', 'scripts'))
 
 def additional_include_files(args=[]):
   """
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to