Bug 905074 - Hide build status markers when not building with mach. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 15 Aug 2013 23:45:08 +0900
changeset 142777 4b83621ceedf0fe341a1a89a98db3f2262bba668
parent 142776 bcfa70489d5ca343cb16141821d1a86e6b79111a
child 142778 0542d2080a0400f4f5110549943cc49f1d76c234
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgps
bugs905074
milestone26.0a1
Bug 905074 - Hide build status markers when not building with mach. r=gps
config/makefiles/precompile/Makefile.in
config/rules.mk
js/src/config/rules.mk
python/mozbuild/mozbuild/base.py
--- a/config/makefiles/precompile/Makefile.in
+++ b/config/makefiles/precompile/Makefile.in
@@ -13,24 +13,24 @@ include $(DEPTH)/config/autoconf.mk
 
 SUPPRESS_DEFAULT_RULES := 1
 
 include $(topsrcdir)/config/rules.mk
 
 # We don't print the build status messages unless we're in a top level build
 # otherwise the output is unexpected and it confuses downstream parsers.
 define make_subtier_dir
-@echo "BUILDSTATUS SUBTIER_START precompile $(1)"
+$(call BUILDSTATUS,SUBTIER_START precompile $(1))
 +$(MAKE) -C $(2) $(3)
-@echo "BUILDSTATUS SUBTIER_FINISH precompile $(1)"
+$(call BUILDSTATUS,SUBTIER_FINISH precompile $(1))
 
 endef
 
 export::
-	@echo "BUILDSTATUS SUBTIERS IPDL WebIDL XPIDL"
+	$(call BUILDSTATUS,SUBTIERS IPDL WebIDL XPIDL)
 
 export:: ipdl webidl xpidl-parser xpidl
 
 ipdl:
 	$(call make_subtier_dir,IPDL,$(DEPTH)/ipc/ipdl,ipdl)
 
 webidl:
 	$(call make_subtier_dir,WebIDL,$(DEPTH)/dom/bindings,webidl)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -427,31 +427,34 @@ endif
 
 ifdef MOZ_UPDATE_XTERM
 # Its good not to have a newline at the end of the titlebar string because it
 # makes the make -s output easier to read.  Echo -n does not work on all
 # platforms, but we can trick printf into doing it.
 UPDATE_TITLE = printf "\033]0;%s in %s\007" $(1) $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2) ;
 endif
 
+ifdef MACH
+BUILDSTATUS=@echo BUILDSTATUS $1
+endif
 # Static directories are largely independent of our build system. But, they
 # could share the same build mechanism (like moz.build files). We need to
 # prevent leaking of our backend state to these independent build systems. This
 # is why MOZBUILD_BACKEND_CHECKED isn't exported to make invocations for static
 # directories.
 define SUBMAKE # $(call SUBMAKE,target,directory,static)
 +@$(UPDATE_TITLE)
 +$(if $(3), MOZBUILD_BACKEND_CHECKED=,) $(MAKE) $(if $(2),-C $(2)) $(1)
 
 endef # The extra line is important here! don't delete it
 
 define TIER_DIR_SUBMAKE
-@echo "BUILDSTATUS TIERDIR_START  $(2)"
+$(call BUILDSTATUS,TIERDIR_START  $(2))
 $(call SUBMAKE,$(1),$(2),$(3))
-@echo "BUILDSTATUS TIERDIR_FINISH $(2)"
+$(call BUILDSTATUS,TIERDIR_FINISH $(2))
 
 endef # Ths empty line is important.
 
 
 ifneq (,$(strip $(DIRS)))
 LOOP_OVER_DIRS = \
   $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
 endif
@@ -677,17 +680,17 @@ SUBMAKEFILES += $(addsuffix /Makefile, $
 
 # 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
 ifndef SUPPRESS_DEFAULT_RULES
 ifdef TIERS
 default all alldep::
-	@echo "BUILDSTATUS TIERS $(TIERS)"
+	$(call BUILDSTATUS,TIERS $(TIERS))
 	$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
 else
 
 default all::
 ifneq (,$(strip $(STATIC_DIRS)))
 	$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,,$(dir),1))
 endif
 	$(MAKE) export
@@ -714,43 +717,36 @@ endif
 
 # This function is called and evaluated to produce the rule to build the
 # specified tier. Each tier begins by building the "static" directories.
 # The BUILDSTATUS echo commands are used to faciliate easier parsing
 # of build output. Build drivers are encouraged to filter these lines
 # from the user.
 define CREATE_TIER_RULE
 tier_$(1)::
-	@echo "BUILDSTATUS TIER_START $(1)"
-	@printf "BUILDSTATUS SUBTIERS"
+	$(call BUILDSTATUS,TIER_START $(1))
+	$(call BUILDSTATUS,SUBTIERS $(if $(tier_$(1)_staticdirs),static )$(if $(tier_$(1)_dirs),export libs tools))
+	$(call BUILDSTATUS,STATICDIRS $$($$@_staticdirs))
+	$(call BUILDSTATUS,DIRS $$($$@_dirs))
 ifneq (,$(tier_$(1)_staticdirs))
-	@printf " static"
+	$(call BUILDSTATUS,SUBTIER_START $(1) static)
+	$$(foreach dir,$$($$@_staticdirs),$$(call TIER_DIR_SUBMAKE,,$$(dir),1))
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) static)
 endif
 ifneq (,$(tier_$(1)_dirs))
-	@printf " export libs tools"
-endif
-	@printf "\n"
-	@echo "BUILDSTATUS STATICDIRS $$($$@_staticdirs)"
-	@echo "BUILDSTATUS DIRS $$($$@_dirs)"
-ifneq (,$(tier_$(1)_staticdirs))
-	@echo "BUILDSTATUS SUBTIER_START $(1) static"
-	$$(foreach dir,$$($$@_staticdirs),$$(call TIER_DIR_SUBMAKE,,$$(dir),1))
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) static"
-endif
-ifneq (,$(tier_$(1)_dirs))
-	@echo "BUILDSTATUS SUBTIER_START $(1) export"
+	$(call BUILDSTATUS,SUBTIER_START $(1) export)
 	$$(MAKE) export_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) export"
-	@echo "BUILDSTATUS SUBTIER_START $(1) libs"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) export)
+	$(call BUILDSTATUS,SUBTIER_START $(1) libs)
 	$$(MAKE) libs_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) libs"
-	@echo "BUILDSTATUS SUBTIER_START $(1) tools"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) libs)
+	$(call BUILDSTATUS,SUBTIER_START $(1) tools)
 	$$(MAKE) tools_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) tools"
-	@echo "BUILDSTATUS TIER_FINISH $(1)"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) tools)
+	$(call BUILDSTATUS TIER_FINISH $(1))
 endif
 endef
 
 $(foreach tier,$(TIERS),$(eval $(call CREATE_TIER_RULE,$(tier))))
 
 # Do everything from scratch
 everything::
 	$(MAKE) clean
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -427,31 +427,34 @@ endif
 
 ifdef MOZ_UPDATE_XTERM
 # Its good not to have a newline at the end of the titlebar string because it
 # makes the make -s output easier to read.  Echo -n does not work on all
 # platforms, but we can trick printf into doing it.
 UPDATE_TITLE = printf "\033]0;%s in %s\007" $(1) $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2) ;
 endif
 
+ifdef MACH
+BUILDSTATUS=@echo BUILDSTATUS $1
+endif
 # Static directories are largely independent of our build system. But, they
 # could share the same build mechanism (like moz.build files). We need to
 # prevent leaking of our backend state to these independent build systems. This
 # is why MOZBUILD_BACKEND_CHECKED isn't exported to make invocations for static
 # directories.
 define SUBMAKE # $(call SUBMAKE,target,directory,static)
 +@$(UPDATE_TITLE)
 +$(if $(3), MOZBUILD_BACKEND_CHECKED=,) $(MAKE) $(if $(2),-C $(2)) $(1)
 
 endef # The extra line is important here! don't delete it
 
 define TIER_DIR_SUBMAKE
-@echo "BUILDSTATUS TIERDIR_START  $(2)"
+$(call BUILDSTATUS,TIERDIR_START  $(2))
 $(call SUBMAKE,$(1),$(2),$(3))
-@echo "BUILDSTATUS TIERDIR_FINISH $(2)"
+$(call BUILDSTATUS,TIERDIR_FINISH $(2))
 
 endef # Ths empty line is important.
 
 
 ifneq (,$(strip $(DIRS)))
 LOOP_OVER_DIRS = \
   $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
 endif
@@ -677,17 +680,17 @@ SUBMAKEFILES += $(addsuffix /Makefile, $
 
 # 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
 ifndef SUPPRESS_DEFAULT_RULES
 ifdef TIERS
 default all alldep::
-	@echo "BUILDSTATUS TIERS $(TIERS)"
+	$(call BUILDSTATUS,TIERS $(TIERS))
 	$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
 else
 
 default all::
 ifneq (,$(strip $(STATIC_DIRS)))
 	$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,,$(dir),1))
 endif
 	$(MAKE) export
@@ -714,43 +717,36 @@ endif
 
 # This function is called and evaluated to produce the rule to build the
 # specified tier. Each tier begins by building the "static" directories.
 # The BUILDSTATUS echo commands are used to faciliate easier parsing
 # of build output. Build drivers are encouraged to filter these lines
 # from the user.
 define CREATE_TIER_RULE
 tier_$(1)::
-	@echo "BUILDSTATUS TIER_START $(1)"
-	@printf "BUILDSTATUS SUBTIERS"
+	$(call BUILDSTATUS,TIER_START $(1))
+	$(call BUILDSTATUS,SUBTIERS $(if $(tier_$(1)_staticdirs),static )$(if $(tier_$(1)_dirs),export libs tools))
+	$(call BUILDSTATUS,STATICDIRS $$($$@_staticdirs))
+	$(call BUILDSTATUS,DIRS $$($$@_dirs))
 ifneq (,$(tier_$(1)_staticdirs))
-	@printf " static"
+	$(call BUILDSTATUS,SUBTIER_START $(1) static)
+	$$(foreach dir,$$($$@_staticdirs),$$(call TIER_DIR_SUBMAKE,,$$(dir),1))
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) static)
 endif
 ifneq (,$(tier_$(1)_dirs))
-	@printf " export libs tools"
-endif
-	@printf "\n"
-	@echo "BUILDSTATUS STATICDIRS $$($$@_staticdirs)"
-	@echo "BUILDSTATUS DIRS $$($$@_dirs)"
-ifneq (,$(tier_$(1)_staticdirs))
-	@echo "BUILDSTATUS SUBTIER_START $(1) static"
-	$$(foreach dir,$$($$@_staticdirs),$$(call TIER_DIR_SUBMAKE,,$$(dir),1))
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) static"
-endif
-ifneq (,$(tier_$(1)_dirs))
-	@echo "BUILDSTATUS SUBTIER_START $(1) export"
+	$(call BUILDSTATUS,SUBTIER_START $(1) export)
 	$$(MAKE) export_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) export"
-	@echo "BUILDSTATUS SUBTIER_START $(1) libs"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) export)
+	$(call BUILDSTATUS,SUBTIER_START $(1) libs)
 	$$(MAKE) libs_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) libs"
-	@echo "BUILDSTATUS SUBTIER_START $(1) tools"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) libs)
+	$(call BUILDSTATUS,SUBTIER_START $(1) tools)
 	$$(MAKE) tools_$$@
-	@echo "BUILDSTATUS SUBTIER_FINISH $(1) tools"
-	@echo "BUILDSTATUS TIER_FINISH $(1)"
+	$(call BUILDSTATUS,SUBTIER_FINISH $(1) tools)
+	$(call BUILDSTATUS TIER_FINISH $(1))
 endif
 endef
 
 $(foreach tier,$(TIERS),$(eval $(call CREATE_TIER_RULE,$(tier))))
 
 # Do everything from scratch
 everything::
 	$(MAKE) clean
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -375,16 +375,19 @@ class MozbuildObject(ProcessExecutionMix
         elif target:
             args.append(target)
 
         fn = self._run_command_in_objdir
 
         if srcdir:
             fn = self._run_command_in_srcdir
 
+        append_env = dict(append_env or ())
+        append_env[b'MACH'] = '1'
+
         params = {
             'args': args,
             'line_handler': line_handler,
             'append_env': append_env,
             'explicit_env': explicit_env,
             'log_level': logging.INFO,
             'require_unix_environment': True,
             'ensure_exit_code': ensure_exit_code,