Bug 978211 - Seemlessly support make 4 output buffering for automation/% steps. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 19 Jun 2014 09:06:13 +0900
changeset 189480 cdb542f9cfc73ff3e5f5da725e2fca408ff8cc49
parent 189479 8c6e3225774d6a51ccb4c5660f8d94a5776c205e
child 189481 c0514bd9d1e0d5aff347773930c2893ca4a6027a
push id26988
push useremorley@mozilla.com
push dateThu, 19 Jun 2014 14:39:10 +0000
treeherdermozilla-central@ad11457bae17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs978211
milestone33.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 978211 - Seemlessly support make 4 output buffering for automation/% steps. r=mshal
build/moz-automation.mk
python/mozbuild/mozbuild/mach_commands.py
--- a/build/moz-automation.mk
+++ b/build/moz-automation.mk
@@ -1,13 +1,21 @@
 #
 # 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/.
 
+ifneq (,$(filter automation/%,$(MAKECMDGOALS)))
+ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
+MAKEFLAGS += --output-sync=target
+else
+.NOTPARALLEL:
+endif
+endif
+
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 # Log file from the 'make upload' step. We need this to parse out the URLs of
 # the uploaded files.
 AUTOMATION_UPLOAD_OUTPUT = $(DIST)/automation-upload.txt
 
 # Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in
 # TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -367,22 +367,20 @@ class Build(MachCommandBase):
                     allow_parallel=False, ensure_exit_code=False, num_jobs=jobs,
                     silent=not verbose, force_pymake=pymake)
 
                 make_extra = self.mozconfig['make_extra'] or []
                 make_extra = dict(m.split('=', 1) for m in make_extra)
 
                 moz_automation = os.getenv('MOZ_AUTOMATION') or make_extra.get('export MOZ_AUTOMATION', None)
                 if moz_automation and status == 0:
-                    # Default to 1 job until we have make-4.0 in for output
-                    # buffering.
                     status = self._run_make(target='automation/build',
                         line_handler=output.on_line, log=False, print_directory=False,
-                        allow_parallel=False, ensure_exit_code=False, num_jobs=1,
-                        silent=not verbose, force_pymake=pymake)
+                        ensure_exit_code=False, num_jobs=jobs, silent=not verbose,
+                        force_pymake=pymake)
 
                 self.log(logging.WARNING, 'warning_summary',
                     {'count': len(monitor.warnings_database)},
                     '{count} compiler warnings present.')
 
             monitor.finish(record_usage=status==0)
 
         high_finder, finder_percent = monitor.have_high_finder_usage()