Bug 915537 - Fix mach build --jobs. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 16 Nov 2013 13:40:03 +0900
changeset 154945 10fecade0b53c3411be67766a4b6c1bbf6535bfe
parent 154944 11a0a8ed61aaee01a7cc73f4220b6d021adf1ae1
child 154946 7bead59330cc3d4108b14443779eeb90e6e44cf5
push id25657
push userMs2ger@gmail.com
push dateSun, 17 Nov 2013 13:24:50 +0000
treeherdermozilla-central@0e88f511e067 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs915537
milestone28.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 915537 - Fix mach build --jobs. r=gps
client.mk
python/mozbuild/mozbuild/base.py
--- a/client.mk
+++ b/client.mk
@@ -123,16 +123,21 @@ MOZCONFIG_OUT_LINES := $(subst $(CR), ,$
 # Filter-out comments from those lines.
 START_COMMENT = \#
 MOZCONFIG_OUT_FILTERED := $(filter-out $(START_COMMENT)%,$(MOZCONFIG_OUT_LINES))
 
 ifdef AUTOCLOBBER
 export AUTOCLOBBER=1
 endif
 
+ifdef MOZ_PARALLEL_BUILD
+  MOZ_MAKE_FLAGS := $(filter-out -j%,$(MOZ_MAKE_FLAGS))
+  MOZ_MAKE_FLAGS += -j$(MOZ_PARALLEL_BUILD)
+endif
+
 # Automatically add -jN to make flags if not defined. N defaults to number of cores.
 ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
   cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
   MOZ_MAKE_FLAGS += -j$(cores)
 endif
 
 
 ifndef MOZ_OBJDIR
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -409,16 +409,18 @@ class MozbuildObject(ProcessExecutionMix
         if filename:
             args.extend(['-f', filename])
 
         if allow_parallel:
             if num_jobs > 0:
                 args.append('-j%d' % num_jobs)
             else:
                 args.append('-j%d' % multiprocessing.cpu_count())
+        elif num_jobs > 0:
+            args.append('MOZ_PARALLEL_BUILD=%d' % num_jobs)
 
         if ignore_errors:
             args.append('-k')
 
         if silent:
             args.append('-s')
 
         # Print entering/leaving directory messages. Some consumers look at