Backed out changeset 23400e395408 (bug 1455892) for linux build bustages on ContentBridgeParent.h CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Thu, 03 May 2018 23:34:54 +0300
changeset 472912 b63df024b6129a1246884b7a251e02ea9f4b45a2
parent 472911 f872dc290835ab15139da3df23113165d263aa09
child 472913 79931e4a2bfb5e81ec7c5e89c5aaeddc732b6e33
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1455892
milestone61.0a1
backs out23400e395408c6816d3afc0d4c192013b4cd8e69
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
Backed out changeset 23400e395408 (bug 1455892) for linux build bustages on ContentBridgeParent.h CLOSED TREE
ipc/ipdl/Makefile.in
ipc/ipdl/ipdl.py
--- a/ipc/ipdl/Makefile.in
+++ b/ipc/ipdl/Makefile.in
@@ -7,32 +7,27 @@ GARBAGE += ipdl_lextab.py ipdl_yacctab.p
 
 ifdef COMPILE_ENVIRONMENT
 
 # This file is generated by the moz.build backend.
 include ipdlsrcs.mk
 
 include $(topsrcdir)/config/rules.mk
 
-ipdl_py_deps := \
-    $(wildcard $(srcdir)/*.py) \
-    $(wildcard $(srcdir)/ipdl/*.py) \
-    $(wildcard $(srcdir)/ipdl/cxx/*.py) \
-    $(wildcard $(topsrcdir)/other-licenses/ply/ply/*.py) \
-    $(NULL)
 
 # NB: the IPDL compiler manages .ipdl-->.h/.cpp dependencies itself,
 # which is why we don't have explicit .h/.cpp targets here
-ipdl.track: $(ALL_IPDLSRCS) $(srcdir)/sync-messages.ini $(srcdir)/message-metadata.ini $(ipdl_py_deps)
+ipdl: $(ALL_IPDLSRCS)
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) \
 	  $(srcdir)/ipdl.py \
 	  --sync-msg-list=$(srcdir)/sync-messages.ini \
 	  --msg-metadata=$(srcdir)/message-metadata.ini \
 	  --outheaders-dir=_ipdlheaders \
 	  --outcpp-dir=. \
 	  $(IPDLDIRS:%=-I%) \
-	  $(ALL_IPDLSRCS)
-	touch $@
+	  $^
 
-export:: ipdl.track
+.PHONY: ipdl
+
+export:: ipdl
 endif
 
--- a/ipc/ipdl/ipdl.py
+++ b/ipc/ipdl/ipdl.py
@@ -1,15 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import optparse, os, re, sys
 from cStringIO import StringIO
+from mozbuild.pythonutil import iter_modules_in_path
 import mozpack.path as mozpath
+import itertools
 from ConfigParser import RawConfigParser
 
 import ipdl
 
 def log(minv, fmt, *args):
     if _verbosity >= minv:
         print fmt % args
 
@@ -47,16 +49,70 @@ cppdir = options.cppdir
 includedirs = [ os.path.abspath(incdir) for incdir in options.includedirs ]
 
 if not len(files):
     op.error("No IPDL files specified")
 
 ipcmessagestartpath = os.path.join(headersdir, 'IPCMessageStart.h')
 ipc_msgtype_name_path = os.path.join(cppdir, 'IPCMessageTypeName.cpp')
 
+# Compiling the IPDL files can take a long time, even on a fast machine.
+# Check to see whether we need to do any work.
+latestipdlmod = max(os.stat(f).st_mtime
+                    for f in itertools.chain(files,
+                                             iter_modules_in_path(mozpath.dirname(__file__))))
+
+def outputModTime(f):
+    # A non-existant file is newer than everything.
+    if not os.path.exists(f):
+        return 0
+    return os.stat(f).st_mtime
+
+# Because the IPDL headers are placed into directories reflecting their
+# namespace, collect a list here so we can easily map output names without
+# parsing the actual IPDL files themselves.
+headersmap = {}
+for (path, dirs, headers) in os.walk(headersdir):
+    for h in headers:
+        base = os.path.basename(h)
+        if base in headersmap:
+            root, ext = os.path.splitext(base)
+            print >>sys.stderr, 'A protocol named', root, 'exists in multiple namespaces'
+            sys.exit(1)
+        headersmap[base] = os.path.join(path, h)
+
+def outputfiles(f):
+    base = os.path.basename(f)
+    root, ext = os.path.splitext(base)
+
+    suffixes = ['']
+    if ext == '.ipdl':
+        suffixes += ['Child', 'Parent']
+
+    for suffix in suffixes:
+        yield os.path.join(cppdir, "%s%s.cpp" % (root, suffix))
+        header = "%s%s.h" % (root, suffix)
+        # If the header already exists on disk, use that.  Otherwise,
+        # just claim that the header is found in headersdir.
+        if header in headersmap:
+            yield headersmap[header]
+        else:
+            yield os.path.join(headersdir, header)
+
+def alloutputfiles():
+    for f in files:
+        for s in outputfiles(f):
+            yield s
+    yield ipcmessagestartpath
+
+earliestoutputmod = min(outputModTime(f) for f in alloutputfiles())
+
+if latestipdlmod < earliestoutputmod:
+    sys.exit(0)
+
 log(2, 'Generated C++ headers will be generated relative to "%s"', headersdir)
 log(2, 'Generated C++ sources will be generated in "%s"', cppdir)
 
 allmessages = {}
 allmessageprognames = []
 allprotocols = []
 
 def normalizedFilename(f):