Bug 875620. Work around bug 874923 by just trying to regenerate all the binding .h and .cpp files if we detect that our dependencies got screwed up. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 28 May 2013 10:11:19 -0400
changeset 144629 ca3cba56b35e1602a1b68e9b8c094e6748eb56a6
parent 144628 6a70ea277263bd7aefa3d60fcaeca989344dbae3
child 144630 d1d114cc60c74b9591b1e6176eefd1f012d60a1f
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs875620, 874923
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 875620. Work around bug 874923 by just trying to regenerate all the binding .h and .cpp files if we detect that our dependencies got screwed up. r=khuey
dom/bindings/BindingGen.py
--- a/dom/bindings/BindingGen.py
+++ b/dom/bindings/BindingGen.py
@@ -47,17 +47,30 @@ def main():
         finally:
             file.close()
         return contents
     allWebIDLFiles = readFile(args[2]).split()
     changedDeps = readFile(args[3]).split()
 
     if all(f.endswith("Binding") or f == "ParserResults.pkl" for f in changedDeps):
         toRegenerate = filter(lambda f: f.endswith("Binding"), changedDeps)
-        toRegenerate = map(lambda f: f[:-len("Binding")] + ".webidl", toRegenerate)
+        if len(toRegenerate) == 0 and len(changedDeps) == 1:
+            # Work around build system bug 874923: if we get here that means
+            # that changedDeps contained only one entry and it was
+            # "ParserResults.pkl".  That should never happen: if the
+            # ParserResults.pkl changes then either one of the globalgen files
+            # changed (in which case we wouldn't be in this "only
+            # ParserResults.pkl and *Binding changed" code) or some .webidl
+            # files changed (and then the corresponding *Binding files should
+            # show up in changedDeps).  Since clearly the build system is
+            # confused, just regenerate everything to be safe.
+            toRegenerate = allWebIDLFiles
+        else:
+            toRegenerate = map(lambda f: f[:-len("Binding")] + ".webidl",
+                               toRegenerate)
     else:
         toRegenerate = allWebIDLFiles
 
     for webIDLFile in toRegenerate:
         assert webIDLFile.endswith(".webidl")
         outputPrefix = webIDLFile[:-len(".webidl")] + "Binding"
         generate_binding_files(config, outputPrefix, srcPrefix, webIDLFile);