Bug 908977 - Generate XPIDL-derived headers directly into dist/include; r=glandium
authorGregory Szorc <gps@mozilla.com>
Wed, 04 Sep 2013 16:52:56 -0700
changeset 158509 ba4acc701c7eba41836a681babc05ded9136bd5f
parent 158508 95e4b6b44eebb9ab0fdf4389f13eb2f3ea527ec1
child 158510 2c0ffcf95bcbf1350e3f3e7f5f45d6dac0843f82
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs908977
milestone26.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 908977 - Generate XPIDL-derived headers directly into dist/include; r=glandium
CLOBBER
config/makefiles/xpidl/Makefile.in
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/CLOBBER
+++ b/CLOBBER
@@ -13,9 +13,9 @@
 #          |               |
 #          O <-- Clobber   O  <-- Clobber
 #
 # Note: The description below will be part of the error message shown to users.
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
-Bug 627487 - random test failures caused by bookmark JSON changes
+Bug 908977 - Generate XPIDL headers directly into dist/include
--- a/config/makefiles/xpidl/Makefile.in
+++ b/config/makefiles/xpidl/Makefile.in
@@ -39,43 +39,35 @@ include $(topsrcdir)/config/rules.mk
 # processing XPIDL files is not trivial, it is preferrable to cache the headers
 # and reinstall them rather than regenerate them. Ideally the dist pruning is
 # performed with manifests. At that time we can write headers directly to the
 # dist directory.
 
 # For dependency files.
 idl_deps_dir := .deps
 
-# Where generated headers go.
-idl_headers_dir := headers
-
 # Where we put our final, linked .xpt files.
 idl_xpt_dir := xpt
 
 dist_idl_dir := $(DIST)/idl
 dist_include_dir := $(DIST)/include
 process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
 
 # TODO we should use py_action, but that would require extra directories to be
 # in the virtualenv.
 idlprocess := $(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_CACHE_DIR) \
     $(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) $(dist_idl_dir) \
-        $(idl_headers_dir) $(idl_xpt_dir) $(idl_deps_dir)
+        $(dist_include_dir) $(idl_xpt_dir) $(idl_deps_dir)
 
-xpidl_headers := @xpidl_headers@
 xpidl_modules := @xpidl_modules@
 
 @xpidl_rules@
 
-dist_headers := $(addprefix $(dist_include_dir)/,$(xpidl_headers))
 linked_xpt_files := $(addprefix $(idl_xpt_dir)/,$(addsuffix .xpt,$(xpidl_modules)))
 depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp)
 
-$(dist_headers): $(dist_include_dir)/%.h: $(idl_headers_dir)/%.h
-	$(INSTALL) $< $(dist_include_dir)
+xpidl:: $(linked_xpt_files)
 
-xpidl:: $(linked_xpt_files) $(dist_headers)
-
-$(linked_xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(idl_headers_dir) $(idl_xpt_dir))
+$(linked_xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir) $(idl_xpt_dir))
 
 $(call include_deps,$(depends_files))
 
 .PHONY: xpidl
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -387,31 +387,29 @@ class RecursiveMakeBackend(CommonBackend
         for subdir in sorted(children):
             self._process_exports(obj, children[subdir], backend_file,
                 namespace=namespace + subdir)
 
     def _handle_idl_manager(self, manager):
         build_files = self._purge_manifests['xpidl']
 
         for p in ('Makefile', 'backend.mk', '.deps/.mkdir.done',
-            'headers/.mkdir.done', 'xpt/.mkdir.done'):
+            'xpt/.mkdir.done'):
             build_files.add(p)
 
         for idl in manager.idls.values():
             self._install_manifests['dist_idl'].add_symlink(idl['source'],
                 idl['basename'])
             self._install_manifests['dist_include'].add_optional_exists('%s.h'
                 % idl['root'])
-            build_files.add(mozpath.join('headers', '%s.h' % idl['root']))
 
         for module in manager.modules:
             build_files.add(mozpath.join('xpt', '%s.xpt' % module))
             build_files.add(mozpath.join('.deps', '%s.pp' % module))
 
-        headers = sorted('%s.h' % idl['root'] for idl in manager.idls.values())
         modules = manager.modules
         xpt_modules = sorted(modules.keys())
         rules = []
 
         for module in xpt_modules:
             deps = sorted(modules[module])
             idl_deps = ['$(dist_idl_dir)/%s.idl' % dep for dep in deps]
             rules.extend([
@@ -426,34 +424,26 @@ class RecursiveMakeBackend(CommonBackend
                 # reference to the new .idl. Since the new .idl presumably has
                 # an mtime newer than the .xpt, it will trigger xpt generation.
                 '$(idl_xpt_dir)/%s.xpt: %s' % (module, ' '.join(idl_deps)),
                 '\t@echo "$(notdir $@)"',
                 '\t$(idlprocess) $(basename $(notdir $@)) %s' % ' '.join(deps),
                 '',
             ])
 
-            # Set up linkage so make knows headers come from $(idlprocess).
-            h = ['$(idl_headers_dir)/%s.h' % dep for dep in deps]
-            rules.extend([
-                '%s: $(idl_xpt_dir)/%s.xpt' % (' '.join(h), module),
-                '',
-            ])
-
         # Create dependency for output header so we force regeneration if the
         # header was deleted. This ideally should not be necessary. However,
         # some processes (such as PGO at the time this was implemented) wipe
         # out dist/include without regard to our install/purge manifests.
 
         out_path = os.path.join(self.environment.topobjdir, 'config',
             'makefiles', 'xpidl', 'Makefile')
         result = self.environment.create_config_file(out_path, extra=dict(
             xpidl_rules='\n'.join(rules),
             xpidl_modules=' '.join(xpt_modules),
-            xpidl_headers=' '.join(headers),
         ))
         self._update_from_avoid_write(result)
         self.summary.managed_count += 1
 
         # The Makefile can't regenerate itself because of custom substitution.
         # We need to list it here to ensure changes cause regeneration.
         self.backend_input_files.add(os.path.join(self.environment.topsrcdir,
             'config', 'makefiles', 'xpidl', 'Makefile.in'))