Bug 1367735 - Do not attempt to generate or install headers or other compile related files during artifact builds. r=mshal
This patch stops GENERATED_FILES from being run during export for artifact
builds and prevents EXPORTS from being processed because some of these will
depend on generated headers.
MozReview-Commit-ID: BHZBFbVHwPT
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -525,17 +525,23 @@ class RecursiveMakeBackend(CommonBackend
'.inc',
'.py',
'.rs',
)
tier = 'export' if any(f.endswith(export_suffixes) for f in obj.outputs) else 'misc'
self._no_skip[tier].add(backend_file.relobjdir)
first_output = obj.outputs[0]
dep_file = "%s.pp" % first_output
- backend_file.write('%s:: %s\n' % (tier, first_output))
+
+ # If we're doing this during export that means we need it during
+ # compile, but if we have an artifact build we don't run compile,
+ # so we can skip it altogether or let the rule run as the result of
+ # something depending on it.
+ if tier == 'misc' or not self.environment.is_artifact_build:
+ backend_file.write('%s:: %s\n' % (tier, first_output))
for output in obj.outputs:
if output != first_output:
backend_file.write('%s: %s ;\n' % (output, first_output))
backend_file.write('GARBAGE += %s\n' % output)
backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
if obj.script:
backend_file.write("""{output}: {script}{inputs}{backend}
\t$(REPORT_BUILD)
@@ -1336,16 +1342,20 @@ class RecursiveMakeBackend(CommonBackend
'dist/xpi-stage',
'_tests',
'dist/include',
'dist/branding',
))
if not path:
raise Exception("Cannot install to " + target)
+ # Exports are not interesting to artifact builds.
+ if path == 'dist/include' and self.environment.is_artifact_build:
+ return
+
manifest = path.replace('/', '_')
install_manifest = self._install_manifests[manifest]
reltarget = mozpath.relpath(target, path)
# Also emit the necessary rules to create $(DIST)/branding during
# partial tree builds. The locale makefiles rely on this working.
if path == 'dist/branding':
backend_file.write('NONRECURSIVE_TARGETS += export\n')