Bug 1501178 - Prioritize directories containing rust compilation in the make backend. r=nalexander
authorChris Manchester <cmanchester@mozilla.com>
Tue, 30 Oct 2018 18:12:30 +0000
changeset 443625 51f379d29373b5ad32dfd65315e1fcb070fdd5ea
parent 443624 ce7098f9ff3ff3fc7f546b3ce8d347a0611c279c
child 443626 7d9f06d99e8e746316872ebc635041b7c25bf3e1
push id109420
push useraciure@mozilla.com
push dateWed, 31 Oct 2018 05:11:56 +0000
treeherdermozilla-inbound@b357da105c49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1501178
milestone65.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 1501178 - Prioritize directories containing rust compilation in the make backend. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D10268
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -806,17 +806,21 @@ class RecursiveMakeBackend(CommonBackend
         #   as direct dependencies of the top recursion target, to somehow
         #   prioritize them.
         #   1. See bug 1262241 comment 5.
         compile_roots = [t for t, deps in self._compile_graph.iteritems()
                          if not deps or t not in all_compile_deps]
 
         def add_category_rules(category, roots, graph):
             rule = root_deps_mk.create_rule(['recurse_%s' % category])
-            rule.add_dependencies(roots)
+            # Directories containing rust compilations don't generally depend
+            # on other directories in the tree, so putting them first here will
+            # start them earlier in the build.
+            rule.add_dependencies(chain((r for r in roots if 'rust' in r),
+                                        (r for r in roots if 'rust' not in r)))
             for target, deps in sorted(graph.items()):
                 if deps:
                     rule = root_deps_mk.create_rule([target])
                     rule.add_dependencies(deps)
 
         non_default_roots = defaultdict(list)
         non_default_graphs = defaultdict(lambda: OrderedDefaultDict(set))