Bug 1241022 - Do not handle HAS_MISC_RULE with affected_tiers. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Jan 2016 14:17:53 +0900
changeset 317860 3a96b4ee3c1f176d128b86654c23b59e502e9fdd
parent 317859 452612abdc8c61d3923dd2dd2cd9c1d247088d8c
child 317861 5bb5c3f415f382f111fe8bdb288916654a19637f
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1241022, 1240676
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 1241022 - Do not handle HAS_MISC_RULE with affected_tiers. r=gps This initiates a move off affected_tiers in VARIABLES definition to explicit in-backend handling, which will hopfully make things clearer. HAS_MISC_RULE is currently used to opt-in to the misc tier in a few directories with a misc:: rule. It is, in fact, mostly used for custom xpi creation, which will be separately addressed in bug 1240676, so it will eventually go away entirely, but in the meantime, we send it as a throwaway passthru.
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -492,16 +492,19 @@ class RecursiveMakeBackend(CommonBackend
             var = suffix_map[obj.canonical_suffix]
             for f in sorted(obj.files):
                 backend_file.write('%s += %s\n' % (
                     var, mozpath.relpath(f, backend_file.srcdir)))
         elif isinstance(obj, VariablePassthru):
             # Sorted so output is consistent and we don't bump mtimes.
             for k, v in sorted(obj.variables.items()):
+                if k == 'HAS_MISC_RULE':
+                    self._no_skip['misc'].add(backend_file.relobjdir)
+                    continue
                 if isinstance(v, list):
                     for item in v:
                             '%s += %s\n' % (k, make_quote(shell_quote(item))))
                 elif isinstance(v, bool):
                     if v:
                         backend_file.write('%s := 1\n' % k)
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1024,17 +1024,17 @@ VARIABLES = {
         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'),
+        """, None),
     'FINAL_TARGET_FILES': (ContextDerivedTypedHierarchicalStringList(Path), 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.
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -590,16 +590,17 @@ class TreeMetadataEmitter(LoggingMixin):
+            'HAS_MISC_RULE',
         for v in varlist:
             if v in context and context[v]:
                 passthru.variables[v] = context[v]
         if context.config.substs.get('OS_TARGET') == 'WINNT' and \
             context['LDFLAGS'].extend([('-DELAYLOAD:%s' % dll)
--- a/python/mozbuild/mozbuild/test/frontend/data/traversal-simple/bar/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/traversal-simple/bar/moz.build
@@ -1,1 +0,0 @@
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -96,18 +96,16 @@ class TestEmitterBasic(unittest.TestCase
         for o in objs:
             self.assertIsInstance(o, DirectoryTraversal)
             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 = [[d.full_path for d in 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')
             ], [], []])