Bug 1303436 - Log status when invoking configure directly from Python. r=mshal
authorChris Manchester <cmanchester@mozilla.com>
Fri, 16 Sep 2016 14:25:51 -0700
changeset 357772 e2a46e7754adb0917ed703ad55cf30aae9d3c0eb
parent 357771 aff0c07fa3dcd6205bef0dba5cb6ff58964ad670
child 357773 89d35548d4fc7868351c5e7c6cc59048b66ff530
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1303436
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1303436 - Log status when invoking configure directly from Python. r=mshal MozReview-Commit-ID: H5gbEdBWCds
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -414,17 +414,18 @@ class Build(MachCommandBase):
             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()
+                    config_rc = self.configure(buildstatus_messages=True,
+                                               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:
@@ -540,26 +541,33 @@ class Build(MachCommandBase):
                 pass
 
         return status
 
     @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):
+    def configure(self, options=None, buildstatus_messages=False, line_handler=None):
         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_make(srcdir=True, filename='client.mk',
-            target='configure', line_handler=on_line, log=False,
+            target='configure', line_handler=line_handler, log=False,
             print_directory=False, allow_parallel=False, ensure_exit_code=False,
-            append_env={b'CONFIGURE_ARGS': options.encode('utf-8'),
-                        b'NO_BUILDSTATUS_MESSAGES': b'1',})
+            append_env=append_env)
 
         if not status:
             print('Configure complete!')
             print('Be sure to run |mach build| to pick up any changes');
 
         return status
 
     @Command('resource-usage', category='post-build',