Bug 1253110 - Don't process XPIDLs during artifact builds on OS X; r?mshal
The new binary artifact archives on OS X contain the XPT and manifest
files derived from XPIDL processing. So we no longer need to process
XPIDL in this configuration.
This fixes a class of artifact build errors where the binaries could be
out of sync with in-tree XPIDL changes, leading to startup failures or
crashes. It also makes artifact builds several seconds faster due to not
having to process XPIDL files and write .xpt files.
The Makefile.in changes to exclude XPIDL processing are somewhat hacky.
But so is nearly everything related to XPIDL processing in make land.
I'm inclined to fix this in follow-up bugs.
MozReview-Commit-ID: FqOjbDtikb
--- a/Makefile.in
+++ b/Makefile.in
@@ -125,20 +125,32 @@ define build_backend_rule
$$($(1)_files):
endef
$(foreach file,$(BUILD_BACKEND_FILES),$(eval $(call build_backend_rule,$(file))))
default:: $(BUILD_BACKEND_FILES)
endif
+# XPIDLs aren't processes for OS X artifact builds.
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ifndef COMPILE_ENVIRONMENT
+no_xpidl=1
+endif
+endif
+
install_manifests := \
- $(addprefix dist/,branding idl include public private sdk xpi-stage) \
+ $(addprefix dist/,branding include public private sdk xpi-stage) \
_tests \
$(NULL)
+
+ifndef no_xpidl
+ install_manifests += dist/idl
+endif
+
# Skip the dist/bin install manifest when using the hybrid
# FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
# xpidl handling to FasterMake in that case, mechanically making the dist/bin
# install manifest non-existent (non-existent manifests being skipped)
ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
install_manifests += dist/bin
endif
install_manifest_depends = \
@@ -162,18 +174,23 @@ install-manifests: $(addprefix install-,
# If we're using the hybrid FasterMake/RecursiveMake backend, we want
# to recurse in the faster/ directory in parallel of install manifests.
# But dist/idl needs to happen before (cf. dependencies in
# config/faster/rules.mk)
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
install-manifests: faster
.PHONY: faster
+faster:
+ $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
+
+ifndef no_xpidl
faster: install-dist/idl
- $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
+endif
+
endif
# process_install_manifest needs to be invoked with --no-remove when building
# js as standalone because automated builds are building nspr separately and
# that would remove the resulting files.
# Eventually, a standalone js build would just be able to build nspr itself,
# removing the need for the former.
ifdef JS_STANDALONE
--- a/python/mozbuild/mozbuild/backend/common.py
+++ b/python/mozbuild/mozbuild/backend/common.py
@@ -240,17 +240,20 @@ class CommonBackend(BuildBackend):
if isinstance(obj, TestManifest):
for test in obj.tests:
self._test_manager.add(test, obj.flavor, obj.topsrcdir,
obj.default_support_files)
self._test_manager.add_installs(obj, obj.topsrcdir)
elif isinstance(obj, XPIDLFile):
# TODO bug 1240134 tracks not processing XPIDL files during
- # artifact builds.
+ # artifact builds. For now, only OS X's artifact builds don't need XPIDL.
+ if self.environment.is_artifact_build and self.environment.defines.get('XP_MACOSX'):
+ return True
+
self._idl_manager.register_idl(obj)
elif isinstance(obj, ConfigFileSubstitution):
# Do not handle ConfigFileSubstitution for Makefiles. Leave that
# to other
if mozpath.basename(obj.output_path) == 'Makefile':
return False
with self._get_preprocessor(obj) as pp:
@@ -338,19 +341,17 @@ class CommonBackend(BuildBackend):
return False
else:
return False
return True
def consume_finished(self):
- if len(self._idl_manager.idls):
- self._handle_idl_manager(self._idl_manager)
-
+ self._handle_idl_manager(self._idl_manager)
self._handle_webidl_collection(self._webidls)
sorted_ipdl_sources = list(sorted(self._ipdl_sources))
def files_from(ipdl):
base = mozpath.basename(ipdl)
root, ext = mozpath.splitext(base)
--- a/xpcom/xpidl/Makefile.in
+++ b/xpcom/xpidl/Makefile.in
@@ -1,11 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ifndef COMPILE_ENVIRONMENT
+no_xpidl=1
+endif
+endif
+
export::
+ifndef no_xpidl
$(call SUBMAKE,xpidllex.py,$(DEPTH)/xpcom/idl-parser/xpidl)
$(call py_action,process_install_manifest,$(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
$(call SUBMAKE,xpidl,$(DEPTH)/config/makefiles/xpidl)
+endif
clean clobber realclean clobber_all distclean::
$(call SUBMAKE,$@,$(DEPTH)/config/makefiles/xpidl)