Bug 1304129 - Use xpidllex.py / xpidlyacc.py from GENERATED_FILES; r?gps draft
authorMike Shal <mshal@mozilla.com>
Mon, 19 Sep 2016 13:47:32 -0400
changeset 415643 fc6982f60d5419151fe0f376f7738c688f86a962
parent 415642 4a4565e953ae873776995a5a5b20a6cbc30d2f88
child 531658 479ad522f1efd1057f3ae7916eec76746a7555dc
push id29922
push userbmo:mshal@mozilla.com
push dateTue, 20 Sep 2016 19:28:03 +0000
reviewersgps
bugs1304129
milestone52.0a1
Bug 1304129 - Use xpidllex.py / xpidlyacc.py from GENERATED_FILES; r?gps MozReview-Commit-ID: 8w50kZWinzl
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -172,67 +172,49 @@ class TupOnly(CommonBackend, PartialBack
             fh.write('ACDEFINES = %s\n' % acdefines_flags)
             fh.write('topsrcdir = $(MOZ_OBJ_ROOT)/%s\n' % (
                 os.path.relpath(self.environment.topsrcdir, self.environment.topobjdir)
             ))
             fh.write('PYTHON = $(MOZ_OBJ_ROOT)/_virtualenv/bin/python -B\n')
             fh.write('PYTHON_PATH = $(PYTHON) $(topsrcdir)/config/pythonpath.py\n')
             fh.write('PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply\n')
             fh.write('IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser\n')
-            fh.write('IDL_PARSER_CACHE_DIR = $(MOZ_OBJ_ROOT)/xpcom/idl-parser\n')
+            fh.write('IDL_PARSER_CACHE_DIR = $(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidl\n')
 
         # Run 'tup init' if necessary.
         if not os.path.exists(mozpath.join(self.environment.topsrcdir, ".tup")):
             tup = self.environment.substs.get('TUP', 'tup')
             self._cmd.run_process(cwd=self.environment.topsrcdir, log_name='tup', args=[tup, 'init'])
 
     def _handle_idl_manager(self, manager):
-
-        # TODO: This should come from GENERATED_FILES, and can be removed once
-        # those are implemented.
-        backend_file = self._get_backend_file('xpcom/idl-parser')
-        backend_file.rule(
-            display='python header.py -> [%o]',
-            cmd=[
-                '$(PYTHON_PATH)',
-                '$(PLY_INCLUDE)',
-                '$(topsrcdir)/xpcom/idl-parser/xpidl/header.py',
-            ],
-            outputs=['xpidlyacc.py', 'xpidllex.py'],
-        )
-
         backend_file = self._get_backend_file('xpcom/xpidl')
-
-        # These are used by mach/mixin/process.py to determine the current
-        # shell.
-        for var in ('SHELL', 'MOZILLABUILD', 'COMSPEC'):
-            backend_file.write('export %s\n' % var)
+        backend_file.export_shell()
 
         for module, data in sorted(manager.modules.iteritems()):
             dest, idls = data
             cmd = [
                 '$(PYTHON_PATH)',
                 '$(PLY_INCLUDE)',
                 '-I$(IDL_PARSER_DIR)',
                 '-I$(IDL_PARSER_CACHE_DIR)',
                 '$(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py',
-                '--cache-dir', '$(MOZ_OBJ_ROOT)/xpcom/idl-parser',
+                '--cache-dir', '$(IDL_PARSER_CACHE_DIR)',
                 '$(DIST)/idl',
                 '$(DIST)/include',
                 '$(MOZ_OBJ_ROOT)/%s/components' % dest,
                 module,
             ]
             cmd.extend(sorted(idls))
 
             outputs = ['$(MOZ_OBJ_ROOT)/%s/components/%s.xpt' % (dest, module)]
             outputs.extend(['$(MOZ_OBJ_ROOT)/dist/include/%s.h' % f for f in sorted(idls)])
             backend_file.rule(
                 inputs=[
-                    '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidllex.py',
-                    '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidlyacc.py',
+                    '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidl/xpidllex.py',
+                    '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidl/xpidlyacc.py',
                 ],
                 display='XPIDL %s' % module,
                 cmd=cmd,
                 outputs=outputs,
             )
 
     def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources,
                              unified_ipdl_cppsrcs_mapping):