Bug 1035543 - Remove the MOZ_PSEUDO_DERECURSE variable. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 10 Jul 2014 14:11:52 +0900
changeset 193259 7ac8d502c5948902b7ccacc6d10d013b20764a92
parent 193258 72b71b739c1e11903a53ee9d84c0ac7374d4722c
child 193260 8e969cdb22512e1a8466f5734b0f601dfafdcd9e
push id7685
push usercbook@mozilla.com
push dateThu, 10 Jul 2014 13:16:10 +0000
treeherderfx-team@e95a69be3f90 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1035543
milestone33.0a1
Bug 1035543 - Remove the MOZ_PSEUDO_DERECURSE variable. r=gps
Makefile.in
build/autoconf/compiler-opts.m4
build/autoconf/config.status.m4
build/docs/build-targets.rst
build/docs/environment-variables.rst
config/config.mk
config/makefiles/target_binaries.mk
config/recurse.mk
config/rules.mk
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/Makefile.in
+++ b/Makefile.in
@@ -162,17 +162,17 @@ export:: install-dist-sdk
 ifndef JS_STANDALONE
 ifdef ENABLE_TESTS
 # Additional makefile targets to call automated test suites
 include $(topsrcdir)/testing/testsuite-targets.mk
 endif
 endif
 
 default all::
-	$(call BUILDSTATUS,TIERS export $(if $(COMPILE_ENVIRONMENT),$(if $(MOZ_PSEUDO_DERECURSE),compile ))libs tools $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
+	$(call BUILDSTATUS,TIERS export $(if $(COMPILE_ENVIRONMENT),compile )libs tools $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
 
 include $(topsrcdir)/config/rules.mk
 
 distclean::
 	$(RM) $(DIST_GARBAGE)
 
 ifeq ($(OS_ARCH),WINNT)
 # we want to copy PDB files on Windows
@@ -304,16 +304,14 @@ source-package install:
 
 # Every export rule depends on config/export, but the rule for config/export
 # doesn't exist when building js non-standalone.
 .PHONY: config/export
 config/export:
 
 endif
 
-ifdef MOZ_PSEUDO_DERECURSE
 # Interdependencies for parallel export.
 js/xpconnect/src/export: dom/bindings/export xpcom/xpidl/export
 accessible/xpcom/export: xpcom/xpidl/export
 ifdef ENABLE_CLANG_PLUGIN
 js/src/export config/export: build/clang-plugin/export
 endif
-endif
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -179,20 +179,16 @@ if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBU
     export MOZ_DEBUG_SYMBOLS
 fi
 
 ])
 
 dnl A high level macro for selecting compiler options.
 AC_DEFUN([MOZ_COMPILER_OPTS],
 [
-  if test "${MOZ_PSEUDO_DERECURSE-unset}" = unset; then
-    MOZ_PSEUDO_DERECURSE=1
-  fi
-
   MOZ_DEBUGGING_OPTS
   MOZ_RTTI
 if test "$CLANG_CXX"; then
     ## We disable return-type-c-linkage because jsval is defined as a C++ type but is
     ## returned by C functions. This is possible because we use knowledge about the ABI
     ## to typedef it to a C type with the same layout when the headers are included
     ## from C.
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage"
--- a/build/autoconf/config.status.m4
+++ b/build/autoconf/config.status.m4
@@ -204,10 +204,8 @@ m4exit(1)
 define([AC_OUTPUT], [ifelse($#_$1, 1_, [MOZ_CREATE_CONFIG_STATUS()
 MOZ_RUN_CONFIG_STATUS()],
 [m4_fatal([Use CONFIGURE_SUBST_FILES in moz.build files to create substituted files.])]
 )])
 
 define([AC_CONFIG_HEADER],
 [m4_fatal([Use CONFIGURE_DEFINE_FILES in moz.build files to produce header files.])
 ])
-
-AC_SUBST([MOZ_PSEUDO_DERECURSE])
--- a/build/docs/build-targets.rst
+++ b/build/docs/build-targets.rst
@@ -15,33 +15,31 @@ partial tree builds can be unreliable. U
 
 export
    Build the *export* tier. The *export* tier builds everything that is
    required for C/C++ compilation. It stages all header files, processes
    IDLs, etc.
 
 compile
    Build the *compile* tier. The *compile* tier compiles all C/C++ files.
-   Only applies to builds with ``MOZ_PSEUDO_DERECURSE``.
 
 libs
    Build the *libs* tier. The *libs* tier performs linking and performs
    most build steps which aren't related to compilation.
 
 tools
    Build the *tools* tier. The *tools* tier mostly deals with supplementary
    tools and compiled tests. It will link tools against libXUL, including
    compiled test binaries.
 
 binaries:
    Recompiles and relinks C/C++ files. Only works after a complete normal
    build, but allows for much faster rebuilds of C/C++ code. For performance
    reasons, however, it skips nss, nspr, icu and ffi. This is targeted to
    improve local developer workflow when touching C/C++ code.
-   Only applies to builds with ``MOZ_PSEUDO_DERECURSE``.
 
 install-manifests
    Process install manifests. Install manifests handle the installation of
    files into the object directory.
 
    Unless ``NO_REMOVE=1`` is defined in the environment, files not accounted
    in the install manifests will be deleted from the object directory.
 
--- a/build/docs/environment-variables.rst
+++ b/build/docs/environment-variables.rst
@@ -24,26 +24,8 @@ REBUILD_CHECK
 MACH_NO_TERMINAL_FOOTER
    If defined, the terminal footer displayed when building with mach in
    a TTY is disabled.
 
 MACH_NO_WRITE_TIMES
    If defined, mach commands will not prefix output lines with the
    elapsed time since program start. This option is equivalent to
    passing ``--log-no-times`` to mach.
-
-MOZ_PSEUDO_DERECURSE
-   Activate an *experimental* build mode where make directory traversal
-   is derecursified. This mode should result in faster build times at
-   the expense of busted builds from time-to-time. The end goal is for
-   this build mode to be the default. At which time, this variable will
-   likely go away.
-
-   A value of ``1`` activates the mode with full optimizations.
-
-   A value of ``no-parallel-export`` activates the mode without
-   optimizations to the *export* tier, which are known to be slightly
-   buggy.
-
-   A value of ``no-skip`` activates the mode without optimizations to skip
-   some directories during traversal.
-
-   Values may be combined with a comma.
--- a/config/config.mk
+++ b/config/config.mk
@@ -193,21 +193,16 @@ BUILD_TOOLS	= $(WIN_TOP_SRC)/build/unix
 else
 win_srcdir	:= $(srcdir)
 BUILD_TOOLS	= $(topsrcdir)/build/unix
 endif
 
 CONFIG_TOOLS	= $(MOZ_BUILD_ROOT)/config
 AUTOCONF_TOOLS	= $(topsrcdir)/build/autoconf
 
-# Disable MOZ_PSEUDO_DERECURSE on PGO builds until it's fixed.
-ifneq (,$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
-MOZ_PSEUDO_DERECURSE :=
-endif
-
 #
 # Strip off the excessively long version numbers on these platforms,
 # but save the version to allow multiple versions of the same base
 # platform to be built in the same tree.
 #
 ifneq (,$(filter FreeBSD HP-UX Linux NetBSD OpenBSD SunOS,$(OS_ARCH)))
 OS_RELEASE	:= $(basename $(OS_RELEASE))
 
--- a/config/makefiles/target_binaries.mk
+++ b/config/makefiles/target_binaries.mk
@@ -95,28 +95,22 @@ ifdef HOST_LIBRARY
 HOST_LIBRARY_FILES = $(HOST_LIBRARY)
 HOST_LIBRARY_DEST ?= $(DIST)/host/lib
 HOST_LIBRARY_TARGET = binaries libs
 INSTALL_TARGETS += HOST_LIBRARY
 endif
 
 endif # !NO_DIST_INSTALL
 
-ifdef MOZ_PSEUDO_DERECURSE
 BINARIES_INSTALL_TARGETS := $(foreach category,$(INSTALL_TARGETS),$(if $(filter binaries,$($(category)_TARGET)),$(category)))
 
 # Fill a dependency file with all the binaries installed somewhere in $(DIST)
 # and with dependencies on the relevant backend files.
 BINARIES_PP := $(MDDEPDIR)/binaries.pp
 
 $(BINARIES_PP): Makefile $(wildcard backend.mk) $(call mkdir_deps,$(MDDEPDIR))
 	@echo '$(strip $(foreach category,$(BINARIES_INSTALL_TARGETS),\
 		$(foreach file,$($(category)_FILES) $($(category)_EXECUTABLES),\
 			$($(category)_DEST)/$(notdir $(file)): $(file)%\
 		)\
 	))binaries: Makefile $(wildcard backend.mk)' | tr % '\n' > $@
 
-else
-binaries::
-	$(error The binaries target is not supported without MOZ_PSEUDO_DERECURSE)
-endif
-
 # EOF
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -17,18 +17,17 @@ endif
 #     Entering qux
 #
 # Pseudo derecurse transforms the above into:
 #   make -C foo
 #   make -C foo/bar
 #   make -C foo/baz
 #   make -C qux
 
-# MOZ_PSEUDO_DERECURSE can have values other than 1.
-ifeq (1_.,$(if $(MOZ_PSEUDO_DERECURSE),1)_$(DEPTH))
+ifeq (.,$(DEPTH))
 
 include root.mk
 
 # Disable build status for mach in top directories without TIERS.
 # In practice this disables it when recursing under js/src, which confuses mach.
 ifndef TIERS
 BUILDSTATUS =
 endif
@@ -101,16 +100,18 @@ GARBAGE_DIRS += subtiers
 
 # 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
 
 ifdef COMPILE_ENVIRONMENT
+# Disable dependency aggregation on PGO builds because of bug 934166.
+ifeq (,$(MOZ_PGO)$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
 ifneq (,$(filter libs binaries,$(CURRENT_TIER)))
 # When doing a "libs" build, target_libs.mk ensures the interesting dependency data
 # is available in the "binaries" stamp. Once recursion is done, aggregate all that
 # dependency info so that stamps depend on relevant files and relevant other stamps.
 # When doing a "binaries" build, the aggregate dependency file and those stamps are
 # used and allow to skip recursing directories where changes are not going to require
 # rebuild. A few directories, however, are still traversed all the time, mostly, the
 # gyp managed ones and js/src.
@@ -130,16 +131,18 @@ ifeq (recurse_binaries,$(MAKECMDGOALS))
 endif
 
 endif
 
 DIST_GARBAGE += binaries-deps.mk binaries-deps
 
 endif
 
+endif
+
 else
 
 # Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above
 ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
 
 compile binaries libs export tools::
 
 else
@@ -180,40 +183,39 @@ endef
 
 tools export:: $(SUBMAKEFILES)
 	$(LOOP_OVER_TOOL_DIRS)
 
 endif # ifdef TIERS
 
 endif # ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
 
-endif # ifeq (1_.,$(MOZ_PSEUDO_DERECURSE)_$(DEPTH))
-
-ifdef MOZ_PSEUDO_DERECURSE
+endif # ifeq (.,$(DEPTH))
 
 ifdef COMPILE_ENVIRONMENT
 
 # Aggregate all dependency files relevant to a binaries build except in
 # the mozilla top-level directory.
 ifneq (.,$(DEPTH))
 ALL_DEP_FILES := \
   $(BINARIES_PP) \
   $(addsuffix .pp,$(addprefix $(MDDEPDIR)/,$(sort \
     $(TARGETS) \
     $(filter-out $(SOBJS) $(ASOBJS) $(EXCLUDED_OBJS),$(OBJ_TARGETS)) \
   ))) \
   $(NULL)
 endif
 
 binaries libs:: $(TARGETS) $(BINARIES_PP)
+# Disable dependency aggregation on PGO builds because of bug 934166.
+ifeq (,$(MOZ_PGO)$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
 ifneq (.,$(DEPTH))
 	@$(if $^,$(call py_action,link_deps,-o binaries --group-all --topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(ALL_DEP_FILES)))
 endif
+endif
 
 endif
 
-endif # ifdef MOZ_PSEUDO_DERECURSE
-
 recurse:
 	@$(RECURSED_COMMAND)
 	$(LOOP_OVER_PARALLEL_DIRS)
 	$(LOOP_OVER_DIRS)
 	$(LOOP_OVER_TOOL_DIRS)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -578,21 +578,19 @@ endif
 endif
 
 # The root makefile doesn't want to do a plain export/libs, because
 # of the tiers and because of libxul. Suppress the default rules in favor
 # of something else. Makefiles which use this var *must* provide a sensible
 # default rule before including rules.mk
 default all::
 	$(MAKE) export
-ifdef MOZ_PSEUDO_DERECURSE
 ifdef COMPILE_ENVIRONMENT
 	$(MAKE) compile
 endif
-endif
 	$(MAKE) libs
 	$(MAKE) tools
 
 ifeq ($(findstring s,$(filter-out --%, $(MAKEFLAGS))),)
 ECHO := echo
 QUIET :=
 else
 ECHO := true
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -315,23 +315,16 @@ class RecursiveMakeBackend(CommonBackend
         self._may_skip = {
             'export': set(),
             'compile': set(),
             'binaries': set(),
             'libs': set(),
             'tools': set(),
         }
 
-        derecurse = self.environment.substs.get('MOZ_PSEUDO_DERECURSE', '').split(',')
-        self._parallel_export = False
-        self._no_skip = False
-        if derecurse != ['']:
-            self._parallel_export = 'no-parallel-export' not in derecurse
-            self._no_skip = 'no-skip' in derecurse
-
     def consume_object(self, obj):
         """Write out build files necessary to build with recursive make."""
 
         if not isinstance(obj, SandboxDerived):
             return
 
         if obj.objdir not in self._backend_files:
             self._backend_files[obj.objdir] = \
@@ -475,21 +468,20 @@ class RecursiveMakeBackend(CommonBackend
         obj.ack()
 
     def _fill_root_mk(self):
         """
         Create two files, root.mk and root-deps.mk, the first containing
         convenience variables, and the other dependency definitions for a
         hopefully proper directory traversal.
         """
-        if not self._no_skip:
-            for tier, skip in self._may_skip.items():
-                self.log(logging.DEBUG, 'fill_root_mk', {
-                    'number': len(skip), 'tier': tier
-                    }, 'Ignoring {number} directories during {tier}')
+        for tier, skip in self._may_skip.items():
+            self.log(logging.DEBUG, 'fill_root_mk', {
+                'number': len(skip), 'tier': tier
+                }, 'Ignoring {number} directories during {tier}')
 
         # Traverse directories in parallel, and skip static dirs
         def parallel_filter(current, subdirs):
             all_subdirs = subdirs.parallel + subdirs.dirs + \
                           subdirs.tests + subdirs.tools
             if current in self._may_skip[tier]:
                 current = None
             # subtiers/*_start and subtiers/*_finish, under subtiers/*, are
@@ -499,24 +491,16 @@ class RecursiveMakeBackend(CommonBackend
                 return current, [], all_subdirs
             return current, all_subdirs, []
 
         # build everything in parallel, including static dirs
         def compile_filter(current, subdirs):
             current, parallel, sequential = parallel_filter(current, subdirs)
             return current, subdirs.static + parallel, sequential
 
-        # 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
-
         # Skip tools dirs during libs traversal. Because of bug 925236 and
         # possible other unknown race conditions, don't parallelize the libs
         # tier.
         def libs_filter(current, subdirs):
             if current in self._may_skip[tier]:
                 current = None
             return current, [], subdirs.parallel + \
                 subdirs.dirs + subdirs.tests
@@ -526,17 +510,17 @@ class RecursiveMakeBackend(CommonBackend
         def tools_filter(current, subdirs):
             if current in self._may_skip[tier]:
                 current = None
             return current, subdirs.parallel, \
                 subdirs.dirs + subdirs.tests + subdirs.tools
 
         # compile, binaries and tools tiers use the same traversal as export
         filters = {
-            'export': export_filter,
+            'export': parallel_filter,
             'compile': compile_filter,
             'binaries': parallel_filter,
             'libs': libs_filter,
             'tools': tools_filter,
         }
 
         root_deps_mk = Makefile()
 
@@ -872,19 +856,16 @@ class RecursiveMakeBackend(CommonBackend
 
         # The directory needs to be registered whether subdirectories have been
         # registered or not.
         self._traversal.add(backend_file.relobjdir)
 
         if obj.is_tool_dir:
             fh.write('IS_TOOL_DIR := 1\n')
 
-        if self._no_skip:
-            return
-
         affected_tiers = set(obj.affected_tiers)
         # Until all SOURCES are really in moz.build, consider all directories
         # building binaries to require a pass at compile, too.
         if 'binaries' in affected_tiers:
             affected_tiers.add('compile')
         if 'compile' in affected_tiers or 'binaries' in affected_tiers:
             affected_tiers.add('libs')
         if obj.is_tool_dir and 'libs' in affected_tiers: