Bug 1319222 - Remove srcdir from BackendTupfile; r=chmanchester
authorMike Shal <mshal@mozilla.com>
Wed, 22 Nov 2017 11:18:28 -0500
changeset 449339 05b9eb8ae66b48feaabb5bc09ddbae21c1c49fce
parent 449338 aca86338b40340ddf9dafe60007cb52f4116c000
child 449340 1c5d8c7e5ddda480693167b8e6c9fb7e0a31c97f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1319222
milestone59.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 1319222 - Remove srcdir from BackendTupfile; r=chmanchester The srcdir does not necessarily directly correspond to the objdir, so it doesn't make sense to tie them together in BackendTupfile. Since the srcdir was only used for the IPDL sources, we can just replace that usage with a local variable. MozReview-Commit-ID: By0N30VTKhh
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -44,19 +44,18 @@ from ..frontend.context import (
     ObjDirPath,
 )
 
 
 class BackendTupfile(object):
     """Represents a generated Tupfile.
     """
 
-    def __init__(self, srcdir, objdir, environment, topsrcdir, topobjdir):
+    def __init__(self, objdir, environment, topsrcdir, topobjdir):
         self.topsrcdir = topsrcdir
-        self.srcdir = srcdir
         self.objdir = objdir
         self.relobjdir = mozpath.relpath(objdir, topobjdir)
         self.environment = environment
         self.name = mozpath.join(objdir, 'Tupfile')
         self.rules_included = False
         self.shell_exported = False
         self.defines = []
         self.host_defines = []
@@ -193,20 +192,19 @@ class TupOnly(CommonBackend, PartialBack
 
         # These are 'group' dependencies - All rules that list these as an output
         # will be built before any rules that list this as an input.
         self._installed_idls = '$(MOZ_OBJ_ROOT)/<installed-idls>'
         self._installed_files = '$(MOZ_OBJ_ROOT)/<installed-files>'
 
     def _get_backend_file(self, relativedir):
         objdir = mozpath.join(self.environment.topobjdir, relativedir)
-        srcdir = mozpath.join(self.environment.topsrcdir, relativedir)
         if objdir not in self._backend_files:
             self._backend_files[objdir] = \
-                    BackendTupfile(srcdir, objdir, self.environment,
+                    BackendTupfile(objdir, self.environment,
                                    self.environment.topsrcdir, self.environment.topobjdir)
         return self._backend_files[objdir]
 
     def _get_backend_file_for(self, obj):
         return self._get_backend_file(obj.relativedir)
 
     def _py_action(self, action):
         cmd = [
@@ -522,22 +520,23 @@ class TupOnly(CommonBackend, PartialBack
         # Preferably we wouldn't have to import ipdl, but we need to parse the
         # ast in order to determine the namespaces since they are used in the
         # header output paths.
         sys.path.append(mozpath.join(self.environment.topsrcdir, 'ipc', 'ipdl'))
         import ipdl
 
         backend_file = self._get_backend_file('ipc/ipdl')
         outheaderdir = '_ipdlheaders'
+        srcdir = mozpath.join(self.environment.topsrcdir, 'ipc/ipdl')
         cmd = [
             '$(PYTHON_PATH)',
             '$(PLY_INCLUDE)',
-            '%s/ipdl.py' % backend_file.srcdir,
-            '--sync-msg-list=%s/sync-messages.ini' % backend_file.srcdir,
-            '--msg-metadata=%s/message-metadata.ini' % backend_file.srcdir,
+            '%s/ipdl.py' % srcdir,
+            '--sync-msg-list=%s/sync-messages.ini' % srcdir,
+            '--msg-metadata=%s/message-metadata.ini' % srcdir,
             '--outheaders-dir=%s' % outheaderdir,
             '--outcpp-dir=.',
         ]
         ipdldirs = sorted(set(mozpath.dirname(p) for p in sorted_ipdl_sources))
         cmd.extend(['-I%s' % d for d in ipdldirs])
         cmd.extend(sorted_ipdl_sources)
 
         outputs = ['IPCMessageTypeName.cpp', mozpath.join(outheaderdir, 'IPCMessageStart.h'), 'ipdl_lextab.py', 'ipdl_yacctab.py']