Bug 915648 - Parallelize make export. r=gps

This commit is contained in:
Mike Hommey 2013-09-20 13:30:17 +09:00
parent 13d7c83e6c
commit 1f9037d4ca
5 changed files with 43 additions and 10 deletions

View File

@ -217,3 +217,10 @@ ifdef ENABLE_TESTS
check::
$(call SUBMAKE,$@,js/src)
endif
ifdef MOZ_PSEUDO_DERECURSE
# Interdependencies for parallel export.
js/xpconnect/src/export: config/makefiles/precompile/export
accessible/src/xpcom/export: config/makefiles/precompile/export
js/src/export: mfbt/export
endif

View File

@ -22,7 +22,8 @@ endif
# make -C foo/baz
# make -C qux
ifeq (1_.,$(MOZ_PSEUDO_DERECURSE)_$(DEPTH))
# MOZ_PSEUDO_DERECURSE can have values other than 1.
ifeq (1_.,$(if $(MOZ_PSEUDO_DERECURSE),1)_$(DEPTH))
include root.mk
@ -88,6 +89,12 @@ ifdef BUG_915535_FIXED
$(call BUILDSTATUS,TIERDIR_FINISH $(CURRENT_TIER) $(subtier_of_$(subst /,_,$*)) $*)
endif
# The export tier requires nsinstall, which is built from config. So every
# subdirectory traversal needs to happen after traversing config.
ifeq ($(CURRENT_TIER),export)
$(addsuffix /$(CURRENT_TIER),$(filter-out config,$(CURRENT_DIRS))): config/$(CURRENT_TIER)
endif
else
# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above, but

View File

@ -88,6 +88,12 @@ ifdef BUG_915535_FIXED
$(call BUILDSTATUS,TIERDIR_FINISH $(CURRENT_TIER) $(subtier_of_$(subst /,_,$*)) $*)
endif
# The export tier requires nsinstall, which is built from config. So every
# subdirectory traversal needs to happen after traversing config.
ifeq ($(CURRENT_TIER),export)
$(addsuffix /$(CURRENT_TIER),$(filter-out config,$(CURRENT_DIRS))): config/$(CURRENT_TIER)
endif
else
# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above, but

View File

@ -1,3 +1,4 @@
DEFINES['FOO'] = '1'
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public

View File

@ -294,6 +294,11 @@ class RecursiveMakeBackend(CommonBackend):
self._traversal = RecursiveMakeTraversal()
derecurse = self.environment.substs.get('MOZ_PSEUDO_DERECURSE', '').split(',')
self._parallel_export = False
if derecurse != [''] and not 'no-parallel-export' in derecurse:
self._parallel_export = True
def _update_from_avoid_write(self, result):
existed, updated = result
@ -390,15 +395,8 @@ class RecursiveMakeBackend(CommonBackend):
convenience variables, and the other dependency definitions for a
hopefully proper directory traversal.
"""
# Skip static dirs during export traversal
def export_filter(current, subdirs):
return current, subdirs.parallel, \
subdirs.dirs + subdirs.tests + subdirs.tools
# compile and tools build everything in parallel, but skip precompile.
def other_filter(current, subdirs):
if current == 'subtiers/precompile':
return None, [], []
# Traverse directories in parallel, and skip static dirs
def parallel_filter(current, subdirs):
all_subdirs = subdirs.parallel + subdirs.dirs + \
subdirs.tests + subdirs.tools
# subtiers/*_start and subtiers/*_finish, under subtiers/*, are
@ -408,6 +406,20 @@ class RecursiveMakeBackend(CommonBackend):
return current, [], all_subdirs
return current, all_subdirs, []
# Skip static dirs during export traversal, or build everything in
# parallel when enabled.
def export_filter(current, subdirs):
if self._parallel_export:
return parallel_filter(current, subdirs)
return current, subdirs.parallel, \
subdirs.dirs + subdirs.tests + subdirs.tools
# compile and tools build everything in parallel, but skip precompile.
def other_filter(current, subdirs):
if current == 'subtiers/precompile':
return None, [], []
return parallel_filter(current, subdirs)
# Skip tools dirs during libs traversal
def libs_filter(current, subdirs):
if current == 'subtiers/precompile':