Bug 1098135 - Traverse directories with misc rules; r=glandium
authorGregory Szorc <gps@mozilla.com>
Wed, 12 Nov 2014 21:59:22 -0800
changeset 242161 dad976bc94f3f51c050715402546c3c0741d2299
parent 242160 fd2d738b5e266c6f9671940f2f695792abce13bb
child 242162 b1a9e41d3f4b1d2720a6f95b84a7f2f8aa9feb48
push id660
push userraliiev@mozilla.com
push dateWed, 18 Feb 2015 20:30:48 +0000
treeherdermozilla-release@49e493494178 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1098135 - Traverse directories with misc rules; r=glandium When the misc tier was added, only directories with misc-associated variables from moz.build were traversed. This patch adds a dummy variable to moz.build whose presence will add the directory to the misc tier. This will enable us to aggressively convert existing libs:: rules to the misc tier.
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -496,16 +496,32 @@ VARIABLES = {
         and read the frontend file there. If there is no frontend file, an error
         is raised.
         Values are relative paths. They can be multiple directory levels
         above or below. Use ``..`` for parent directories and ``/`` for path
         """, None),
+    'HAS_MISC_RULE': (bool, bool,
+        """Whether this directory should be traversed in the ``misc`` tier.
+        Many ``libs`` rules still exist in Makefile.in files. We highly prefer
+        that these rules exist in the ``misc`` tier/target so that they can be
+        executed concurrently during tier traversal (the ``misc`` tier is
+        fully concurrent).
+        Presence of this variable indicates that this directory should be
+        traversed by the ``misc`` tier.
+        Please note that converting ``libs`` rules to the ``misc`` tier must
+        be done with care, as there are many implicit dependencies that can
+        break the build in subtle ways.
+        """, 'misc'),
     'FINAL_TARGET_FILES': (HierarchicalStringList, list,
         """List of files to be installed into the application directory.
         ``FINAL_TARGET_FILES`` will copy (or symlink, if the platform supports it)
         the contents of its files to the directory specified by
         ``FINAL_TARGET`` (typically ``dist/bin``). Files that are destined for a
         subdirectory can be specified by accessing a field, or as a dict access.
         For example, to export ``foo.png`` to the top-level directory and
--- a/python/mozbuild/mozbuild/test/frontend/data/traversal-simple/bar/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/traversal-simple/bar/moz.build
@@ -0,0 +1,1 @@
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -93,16 +93,18 @@ class TestEmitterBasic(unittest.TestCase
             self.assertIsInstance(o, DirectoryTraversal)
             self.assertEqual(o.test_dirs, [])
             self.assertEqual(len(o.context_all_paths), 1)
         reldirs = [o.relativedir for o in objs]
         self.assertEqual(reldirs, ['', 'foo', 'foo/biz', 'bar'])
+        self.assertEqual(objs[3].affected_tiers, {'misc'})
         dirs = [o.dirs for o in objs]
         self.assertEqual(dirs, [
                 mozpath.join(reader.config.topsrcdir, 'foo'),
                 mozpath.join(reader.config.topsrcdir, 'bar')
             ], [
                 mozpath.join(reader.config.topsrcdir, 'foo', 'biz')
             ], [], []])