Bug 933145 - Skip directories without variables in moz.build that are relevant to compile or binaries during those tiers. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 Nov 2013 10:37:44 +0900
changeset 153893 efd4f2b7cdabc2ee23b4d3438b8ab4c26edb2b17
parent 153892 f2c1c0a02595786f07cb660a8d1f0fc2f9ad3c9b
child 153894 a356d5b033172c56957d9865d431aa13d7f72db0
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs933145
milestone28.0a1
Bug 933145 - Skip directories without variables in moz.build that are relevant to compile or binaries during those tiers. r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -659,33 +659,33 @@ class RecursiveMakeBackend(CommonBackend
 
                     # Adding the Makefile.in here has the desired side-effect
                     # that if the Makefile.in disappears, this will force
                     # moz.build traversal. This means that when we remove empty
                     # Makefile.in files, the old file will get replaced with
                     # the autogenerated one automatically.
                     self.backend_input_files.add(makefile_in)
 
-                    for skiplist in self._may_skip.values():
+                    for tier, skiplist in self._may_skip.items():
+                        if tier in ('compile', 'binaries'):
+                            continue
                         if bf.relobjdir in skiplist:
                             skiplist.remove(bf.relobjdir)
                 else:
                     self.log(logging.DEBUG, 'stub_makefile',
                         {'path': makefile}, 'Creating stub Makefile: {path}')
 
                 # Can't skip directories with a jar.mn for the 'libs' tier.
                 if bf.relobjdir in self._may_skip['libs'] and \
                         os.path.exists(os.path.join(srcdir, 'jar.mn')):
                     self._may_skip['libs'].remove(bf.relobjdir)
 
                 with self._write_file(makefile) as fh:
                     bf.environment.create_makefile(fh, stub=stub)
 
-        self._fill_root_mk()
-
         # Write out a master list of all IPDL source files.
         ipdl_dir = os.path.join(self.environment.topobjdir, 'ipc', 'ipdl')
         mk = mozmakeutil.Makefile()
 
         sorted_ipdl_sources = list(sorted(self._ipdl_sources))
         mk.add_statement('ALL_IPDLSRCS := %s' % ' '.join(sorted_ipdl_sources))
 
         def files_from(ipdl):
@@ -706,16 +706,18 @@ class RecursiveMakeBackend(CommonBackend
                                       unified_files_makefile_variable='CPPSRCS')
 
         mk.add_statement('IPDLDIRS := %s' % ' '.join(sorted(set(os.path.dirname(p)
             for p in self._ipdl_sources))))
 
         with self._write_file(os.path.join(ipdl_dir, 'ipdlsrcs.mk')) as ipdls:
             mk.dump(ipdls, removal_guard=False)
 
+        self._may_skip['compile'] -= set(['ipc/ipdl'])
+
         # Write out master lists of WebIDL source files.
         bindings_dir = os.path.join(self.environment.topobjdir, 'dom', 'bindings')
 
         mk = mozmakeutil.Makefile()
 
         def write_var(variable, sources):
             files = [os.path.basename(f) for f in sorted(sources)]
             mk.add_statement('%s += %s' % (variable, ' '.join(files)))
@@ -739,16 +741,20 @@ class RecursiveMakeBackend(CommonBackend
                                       unified_files_makefile_variable='unified_binding_cpp_files',
                                       poison_windows_h=True)
 
         # Assume that Somebody Else has responsibility for correctly
         # specifying removal dependencies for |all_webidl_sources|.
         with self._write_file(os.path.join(bindings_dir, 'webidlsrcs.mk')) as webidls:
             mk.dump(webidls, removal_guard=False)
 
+        self._may_skip['compile'] -= set(['dom/bindings', 'dom/bindings/test'])
+
+        self._fill_root_mk()
+
         # Write out a dependency file used to determine whether a config.status
         # re-run is needed.
         inputs = sorted(p.replace(os.sep, '/') for p in self.backend_input_files)
 
         # We need to use $(DEPTH) so the target here matches what's in
         # rules.mk. If they are different, the dependencies don't get pulled in
         # properly.
         with self._write_file('%s.pp' % self._backend_output_list_file) as backend_deps:
@@ -863,16 +869,20 @@ class RecursiveMakeBackend(CommonBackend
 
         if obj.is_tool_dir:
             fh.write('IS_TOOL_DIR := 1\n')
 
         if self._no_skip:
             return
 
         affected_tiers = set(obj.affected_tiers)
+        # Until all SOURCES are really in moz.build, consider all directories
+        # building binaries to require a pass at compile, too.
+        if 'binaries' in affected_tiers:
+            affected_tiers.add('compile')
         if 'compile' in affected_tiers or 'binaries' in affected_tiers:
             affected_tiers.add('libs')
         if obj.is_tool_dir and 'libs' in affected_tiers:
             affected_tiers.remove('libs')
             affected_tiers.add('tools')
 
         for tier in set(self._may_skip.keys()) - affected_tiers:
             self._may_skip[tier].add(backend_file.relobjdir)