diff --git a/client.mk b/client.mk index 951f3a1670575..27556a4564890 100644 --- a/client.mk +++ b/client.mk @@ -432,15 +432,6 @@ endif # MOZ_CURRENT_PROJECT #################################### # Postflight, after building all projects -ifdef MOZ_AUTOMATION -ifndef MOZ_CURRENT_PROJECT -realbuild:: -# Only run the automation/build target for the first project. -# (i.e. first platform of universal builds) - $(MAKE) -f $(TOPSRCDIR)/client.mk automation/build $(addprefix MOZ_CURRENT_PROJECT=,$(firstword $(MOZ_BUILD_PROJECTS))) -endif -endif - realbuild postflight_all:: ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1)) # Don't run postflight_all for individual projects in multi-project builds diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index d30e370de7f0d..a2cb8db61945d 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -434,6 +434,27 @@ def build(self, what=None, disable_extra_make_dependencies=None, jobs=0, allow_parallel=False, ensure_exit_code=False, num_jobs=jobs, silent=not verbose) + make_extra = self.mozconfig['make_extra'] or [] + make_extra = dict(m.split('=', 1) for m in make_extra) + + # For universal builds, we need to run the automation steps in + # the first architecture from MOZ_BUILD_PROJECTS + projects = make_extra.get('MOZ_BUILD_PROJECTS') + append_env = None + if projects: + project = projects.split()[0] + append_env = {b'MOZ_CURRENT_PROJECT': project.encode('utf-8')} + subdir = os.path.join(self.topobjdir, project) + else: + subdir = self.topobjdir + moz_automation = os.getenv('MOZ_AUTOMATION') or make_extra.get('export MOZ_AUTOMATION', None) + if moz_automation and status == 0: + status = self._run_make(target='automation/build', directory=subdir, + line_handler=output.on_line, log=False, print_directory=False, + ensure_exit_code=False, num_jobs=jobs, silent=not verbose, + append_env=append_env + ) + self.log(logging.WARNING, 'warning_summary', {'count': len(monitor.warnings_database)}, '{count} compiler warnings present.')