Bug 1412460 - Always evaluate config environment; r?build draft
authorGregory Szorc <gps@mozilla.com>
Fri, 27 Oct 2017 17:14:00 -0700
changeset 690350 aedb01ab8b0c1f0bb03e5597a918ade6f78e7625
parent 690349 3e204c23c077e5beb890af57dad6b7fe9c82bede
child 690351 329cb80fda3ce313bc7e7f99201737ecd159b44d
push id87287
push usergszorc@mozilla.com
push dateWed, 01 Nov 2017 22:07:23 +0000
reviewersbuild
bugs1412460
milestone58.0a1
Bug 1412460 - Always evaluate config environment; r?build I /think/ the only scenario where we wouldn't be able to evaluate a config environment after configure was the case where MOZ_BUILD_PROJECTS was in play. Since we removed support for that feature, let's drop support for treating the config environment as optional. MozReview-Commit-ID: 4sz9dOwaA3y
python/mozbuild/mozbuild/controller/building.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1091,39 +1091,30 @@ class BuildDriver(MozbuildObject):
                         keep_going=keep_going)
 
                     if status != 0:
                         break
             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)
                     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:
-                        config = self.config_environment
-                    except Exception:
-                        pass
+                    config = self.config_environment
 
-                if config:
-                    active_backend = config.substs.get('BUILD_BACKENDS', [None])[0]
-                    if active_backend:
-                        backend_cls = get_backend_class(active_backend)(config)
-                        status = backend_cls.build(self, output, jobs, verbose)
+                active_backend = config.substs.get('BUILD_BACKENDS', [None])[0]
+                if active_backend:
+                    backend_cls = get_backend_class(active_backend)(config)
+                    status = backend_cls.build(self, output, jobs, verbose)
 
                 # If the backend doesn't specify a build() method, then just
                 # call client.mk directly.
                 if status is None:
                     status = self._run_make(srcdir=True, filename='client.mk',
                         line_handler=output.on_line, log=False, print_directory=False,
                         allow_parallel=False, ensure_exit_code=False, num_jobs=jobs,
                         silent=not verbose, keep_going=keep_going)