Bug 915537 - Fix mach build --jobs. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 16 Nov 2013 13:40:03 +0900
changeset 154974 10fecade0b53c3411be67766a4b6c1bbf6535bfe
parent 154973 11a0a8ed61aaee01a7cc73f4220b6d021adf1ae1
child 154975 7bead59330cc3d4108b14443779eeb90e6e44cf5
push id3492
push userMs2ger@gmail.com
push dateSun, 17 Nov 2013 13:29:07 +0000
treeherderfx-team@99084b22e38d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs915537
milestone28.0a1
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