Bug 1417684 - Remove BUILDSTATUS messages from client.mk; r?build draft
authorGregory Szorc <gps@mozilla.com>
Thu, 16 Nov 2017 15:55:05 -0800
changeset 699373 c79d7e5dd7ca462cdbb0e5029b6c7845485b40c3
parent 699372 2535ab6f982e3ec78cd094cf14fb9966abe98636
child 699374 229f8ab0b3824e38e151874d233453b746fde40e
push id89551
push userbmo:gps@mozilla.com
push dateFri, 17 Nov 2017 03:41:34 +0000
reviewersbuild
bugs1417684
milestone59.0a1
Bug 1417684 - Remove BUILDSTATUS messages from client.mk; r?build When `mach build` sees lines beginning with BUILDSTATUS, it feeds that into the resource collection mechanism so it knows how long various operations take and what resources they consume. As I started writing the patches to move client.mk's configure logic to Python, I couldn't figure out an obvious way to work in metrics collection without making code review difficult. So the plan is to temporarily remove this feature then restore it once configure is being invoked from Python. I wanted this to be called out explicitly in its own commit so it isn't lost in an upcoming large patch. MozReview-Commit-ID: 5cg9qlH91CT
client.mk
python/mozbuild/mozbuild/controller/building.py
python/mozbuild/mozbuild/mach_commands.py
--- a/client.mk
+++ b/client.mk
@@ -11,26 +11,16 @@
 #
 # Options:
 #   MOZ_OBJDIR           - Destination object directory
 #   MOZ_MAKE_FLAGS       - Flags to pass to $(MAKE)
 #
 #######################################################################
 # Defines
 
-ifdef MACH
-ifndef NO_BUILDSTATUS_MESSAGES
-define BUILDSTATUS
-@echo 'BUILDSTATUS $1'
-
-endef
-endif
-endif
-
-
 CWD := $(CURDIR)
 
 ifeq "$(CWD)" "/"
 CWD   := /.
 endif
 
 PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
 
@@ -137,25 +127,22 @@ endif
 configure-files: $(CONFIGURES)
 
 configure-preqs = \
   configure-files \
   $(OBJDIR)/.mozconfig.json \
   $(NULL)
 
 configure:: $(configure-preqs)
-	$(call BUILDSTATUS,TIERS configure)
-	$(call BUILDSTATUS,TIER_START configure)
 	@echo cd $(OBJDIR);
 	@echo $(CONFIGURE) $(CONFIGURE_ARGS)
 	@cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
 	  || ( echo '*** Fix above errors and then restart with\
                "$(MAKE) -f client.mk build"' && exit 1 )
 	@touch $(OBJDIR)/Makefile
-	$(call BUILDSTATUS,TIER_FINISH configure)
 
 ifneq (,$(MAKEFILE))
 $(OBJDIR)/Makefile: $(OBJDIR)/config.status
 
 $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
 else
 $(OBJDIR)/Makefile: $(CONFIG_STATUS_DEPS)
 endif
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1095,18 +1095,17 @@ class BuildDriver(MozbuildObject):
             else:
                 # Try to call the default backend's build() method. This will
                 # run configure to determine BUILD_BACKENDS if it hasn't run
                 # yet.
                 config = None
                 try:
                     config = self.config_environment
                 except Exception:
-                    config_rc = self.configure(buildstatus_messages=True,
-                                               line_handler=output.on_line)
+                    config_rc = self.configure(line_handler=output.on_line)
                     if config_rc != 0:
                         return config_rc
 
                     # Even if configure runs successfully, we may have trouble
                     # getting the config_environment for some builds, such as
                     # OSX Universal builds. These have to go through client.mk
                     # regardless.
                     try:
@@ -1276,34 +1275,29 @@ class BuildDriver(MozbuildObject):
                         'https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox')
             except Exception:
                 # Ignore Exceptions in case we can't find config.status (such
                 # as when doing OSX Universal builds)
                 pass
 
         return status
 
-    def configure(self, options=None, buildstatus_messages=False,
-                  line_handler=None):
+    def configure(self, options=None, line_handler=None):
         # Disable indexing in objdir because it is not necessary and can slow
         # down builds.
         mkdir(self.topobjdir, not_indexed=True)
 
         def on_line(line):
             self.log(logging.INFO, 'build_output', {'line': line}, '{line}')
 
         line_handler = line_handler or on_line
 
         options = ' '.join(shell_quote(o) for o in options or ())
         append_env = {b'CONFIGURE_ARGS': options.encode('utf-8')}
 
-        # Only print build status messages when we have an active
-        # monitor.
-        if not buildstatus_messages:
-            append_env[b'NO_BUILDSTATUS_MESSAGES'] =  b'1'
         status = self._run_client_mk(target='configure',
                                      line_handler=line_handler,
                                      append_env=append_env)
 
         if not status:
             print('Configure complete!')
             print('Be sure to run |mach build| to pick up any changes');
 
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -168,27 +168,26 @@ class Build(MachCommandBase):
             verbose=verbose,
             keep_going=keep_going,
             mach_context=self._mach_context)
 
     @Command('configure', category='build',
         description='Configure the tree (run configure and config.status).')
     @CommandArgument('options', default=None, nargs=argparse.REMAINDER,
                      help='Configure options')
-    def configure(self, options=None, buildstatus_messages=False, line_handler=None):
+    def configure(self, options=None, line_handler=None):
         from mozbuild.controller.building import (
             BuildDriver,
         )
 
         self.log_manager.enable_all_structured_loggers()
         driver = self._spawn(BuildDriver)
 
         return driver.configure(
             options=options,
-            buildstatus_messages=buildstatus_messages,
             line_handler=line_handler)
 
     @Command('resource-usage', category='post-build',
         description='Show information about system resource usage for a build.')
     @CommandArgument('--address', default='localhost',
         help='Address the HTTP server should listen on.')
     @CommandArgument('--port', type=int, default=0,
         help='Port number the HTTP server should listen on.')