Bug 1114669 - Use a generated list of idl deps for xpt generation. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 12 Feb 2015 09:44:16 +0900
changeset 228924 e0a40aa0a2816247452a9f80d8f3e3e6d1c31074
parent 228923 bd34e4330662fdbe9ffc897f055a62c2febff6ad
child 228925 535453825f6dd51113f73957565ddc555ce879a9
push id28274
push usercbook@mozilla.com
push dateFri, 13 Feb 2015 16:03:46 +0000
treeherdermozilla-central@8f9d3dabd12e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1114669
milestone38.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 1114669 - Use a generated list of idl deps for xpt generation. r=gps Generating the list of idl deps to generate an xpt from its dependency list makes us give all _previous_ dependencies, inherited from the .deps makefiles. This leads to removed files being listed on xpidl-process.py command line, and the command subsequently failing. Instead, use generated lists of idl dependencies. At the same time, lighten the generated Makefile further by not emitting xpt dependencies on their containing directory, and instead generating it from the $xpt_files list. This brings down the Makefile size from 100k to 38k.
config/makefiles/xpidl/Makefile.in
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/config/makefiles/xpidl/Makefile.in
+++ b/config/makefiles/xpidl/Makefile.in
@@ -36,26 +36,28 @@ endif
 
 # TODO we should use py_action, but that would require extra directories to be
 # in the virtualenv.
 %.xpt:
 	@echo "$(@F)"
 	$(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_CACHE_DIR) \
 		$(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) $(dist_idl_dir) \
 		$(dist_include_dir) $(@D) $(idl_deps_dir) $(libxul_sdk_includes) \
-		$(basename $(notdir $@ $(filter %.idl,$^)))
+		$(basename $(notdir $@)) $($(basename $(notdir $@))_deps)
 
 xpidl_modules := @xpidl_modules@
 xpt_files := @xpt_files@
 
 @xpidl_rules@
 
 depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp)
 
 GARBAGE += $(xpt_files) $(depends_files)
 
 xpidl:: $(xpt_files)
 
 $(xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir))
 
+$(foreach xpt,$(xpt_files),$(eval $(xpt): $(call mkdir_deps,$(dir $(xpt)))))
+
 $(call include_deps,$(depends_files))
 
 .PHONY: xpidl
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -930,19 +930,17 @@ INSTALL_TARGETS += %(prefix)s
             # else has changed, the new .idl won't be referenced anywhere
             # except in the command invocation. Therefore, the .xpt won't
             # be rebuilt because the dependencies say it is up to date. By
             # listing the .idls here, we ensure the make file has a
             # reference to the new .idl. Since the new .idl presumably has
             # an mtime newer than the .xpt, it will trigger xpt generation.
             xpt_path = '$(DEPTH)/%s/components/%s.xpt' % (install_target, module)
             xpt_files.add(xpt_path)
-            rule = mk.create_rule([xpt_path])
-            rule.add_dependencies(['$(call mkdir_deps,%s)' % mozpath.dirname(xpt_path)])
-            rule.add_dependencies(manager.idls['%s.idl' % dep]['source'] for dep in deps)
+            mk.add_statement('%s_deps = %s' % (module, ' '.join(deps)))
 
             if install_target.startswith('dist/'):
                 path = mozpath.relpath(xpt_path, '$(DEPTH)/dist')
                 prefix, subpath = path.split('/', 1)
                 key = 'dist_%s' % prefix
 
                 self._install_manifests[key].add_optional_exists(subpath)