Bug 1047267 - Remove the trigger hacks added in bug 1043344. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 Aug 2014 14:21:09 +0900
changeset 198273 af7e67f1af51574477b4abc8bc7df2b7e35a3059
parent 198272 6b285759568cb0b743cb9497e021f6552cc7e349
child 198274 548f678aa12070d80a98f6f4c4c95edde4d30067
push id27265
push useremorley@mozilla.com
push dateThu, 07 Aug 2014 12:49:34 +0000
treeherdermozilla-central@bf5cbb36f4d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1047267, 1043344
milestone34.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 1047267 - Remove the trigger hacks added in bug 1043344. r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/reader.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -306,17 +306,16 @@ class RecursiveMakeBackend(CommonBackend
                 'dist_private',
                 'dist_sdk',
                 'tests',
                 'xpidl',
             ]}
 
         self._traversal = RecursiveMakeTraversal()
         self._compile_graph = defaultdict(set)
-        self._triggers = defaultdict(set)
 
         self._may_skip = {
             'export': set(),
             'libs': set(),
         }
         self._no_skip = {
             'tools': set(),
         }
@@ -698,22 +697,16 @@ class RecursiveMakeBackend(CommonBackend
                 obj.output_path = makefile
                 obj.input_path = makefile_in
                 obj.topsrcdir = bf.environment.topsrcdir
                 obj.topobjdir = bf.environment.topobjdir
                 obj.config = bf.environment
                 self._create_makefile(obj, stub=stub)
                 with open(obj.output_path) as fh:
                     content = fh.read()
-                    for trigger, targets in self._triggers.items():
-                        if trigger.encode('ascii') in content:
-                            for target in targets:
-                                t = '%s/target' % mozpath.relpath(objdir,
-                                    self.environment.topobjdir)
-                                self._compile_graph[t].add(target)
                     # Skip every directory but those with a Makefile
                     # containing a tools target, or XPI_PKGNAME or
                     # INSTALL_EXTENSION_ID.
                     for t in (b'XPI_PKGNAME', b'INSTALL_EXTENSION_ID',
                             b'tools'):
                         if t not in content:
                             continue
                         if t == b'tools' and not re.search('(?:^|\s)tools.*::', content, re.M):
@@ -810,20 +803,16 @@ class RecursiveMakeBackend(CommonBackend
             if dirs:
                 fh.write('tier_%s_dirs += %s\n' % (tier, ' '.join(dirs)))
                 fh.write('DIRS += $(tier_%s_dirs)\n' % tier)
                 self._traversal.add('subtiers/%s' % tier,
                                     dirs=relativize(dirs))
 
             self._traversal.add('', dirs=['subtiers/%s' % tier])
 
-            for d in dirs:
-                if d.trigger:
-                    self._triggers[d.trigger].add('%s/target' % d)
-
         if obj.dirs:
             fh.write('DIRS := %s\n' % ' '.join(obj.dirs))
             self._traversal.add(backend_file.relobjdir, dirs=relativize(obj.dirs))
 
         if obj.test_dirs:
             fh.write('TEST_DIRS := %s\n' % ' '.join(obj.test_dirs))
             if self.environment.substs.get('ENABLE_TESTS', False):
                 self._traversal.add(backend_file.relobjdir,
@@ -1035,21 +1024,16 @@ class RecursiveMakeBackend(CommonBackend
         backend_file.write('PROGRAM = %s\n' % program)
 
     def _process_host_program(self, program, backend_file):
         backend_file.write('HOST_PROGRAM = %s\n' % program)
 
     def _process_simple_program(self, obj, backend_file):
         if obj.is_unit_test:
             backend_file.write('CPP_UNIT_TESTS += %s\n' % obj.program)
-            # config.mk adds a dependency on NSPR_LIBS for CPP_UNIT_TESTS
-            # Add it here until moz.build land handles this.
-            if 'NSPR_LIBS' in self._triggers:
-                self._compile_graph[self._build_target_for_obj(obj)] |= \
-                    self._triggers['NSPR_LIBS']
         else:
             backend_file.write('SIMPLE_PROGRAMS += %s\n' % obj.program)
 
     def _process_host_simple_program(self, program, backend_file):
         backend_file.write('HOST_SIMPLE_PROGRAMS += %s\n' % program)
 
     def _process_test_manifest(self, obj, backend_file):
         # Much of the logic in this function could be moved to CommonBackend.
--- a/python/mozbuild/mozbuild/frontend/reader.py
+++ b/python/mozbuild/mozbuild/frontend/reader.py
@@ -99,20 +99,16 @@ def is_read_allowed(path, config):
         external = mozpath.normpath(external)
 
         if path.startswith(external):
             return True
 
     return False
 
 
-class PathWithTrigger(unicode):
-    __slots__ = ('trigger',)
-
-
 class SandboxCalledError(SandboxError):
     """Represents an error resulting from calling the error() function."""
 
     def __init__(self, file_stack, message):
         SandboxError.__init__(self, file_stack)
         self.message = message
 
 
@@ -276,35 +272,33 @@ class MozbuildSandbox(Sandbox):
         return data
 
     def _add_android_eclipse_library_project(self, name):
         data = self.add_android_eclipse_project_helper(name)
         data.manifest = None
         data.is_library = True
         return data
 
-    def _add_tier_directory(self, tier, reldir, external=False, trigger=None):
+    def _add_tier_directory(self, tier, reldir, external=False):
         """Register a tier directory with the build."""
         if isinstance(reldir, text_type):
             reldir = [reldir]
 
         if not tier in self['TIERS']:
             self['TIERS'][tier] = {
                 'regular': [],
                 'external': [],
             }
 
         key = 'external' if external else 'regular'
         for path in reldir:
             if path in self['TIERS'][tier][key]:
                 raise Exception('Directory has already been registered with '
                     'tier: %s' % path)
 
-            path = PathWithTrigger(path)
-            path.trigger = trigger
             self['TIERS'][tier][key].append(path)
 
     def _export(self, varname):
         """Export the variable to all subdirectories of the current path."""
 
         exports = self.metadata.setdefault('exports', dict())
         if varname in exports:
             raise Exception('Variable has already been exported: %s' % varname)
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -897,21 +897,16 @@ FUNCTIONS = {
         Register multiple directories with the 'app' tier.::
 
            add_tier_dir('app', ['components', 'base'])
 
         Register a directory as having external content (no dependencies,
         and traversed with export, libs, and tools subtiers::
 
            add_tier_dir('base', 'bar', external=True)
-
-        Note there is a temporary ``trigger`` parameter that tells the build
-        system that if it sees the given string in a Makefile, then the compile
-        rules in that directory depend on the directories listed in the
-        add_tier_dir call.
         """),
 
     'export': ('_export', (str,),
         """Make the specified variable available to all child directories.
 
         The variable specified by the argument string is added to the
         environment of all directories specified in the DIRS and TEST_DIRS
         variables. If those directories themselves have child directories,