Bug 1412460 - Always evaluate config environment; r?build draft
authorGregory Szorc <gps@mozilla.com>
Fri, 27 Oct 2017 17:14:00 -0700
changeset 688048 3ac6e9702f96eb0906fdeefaebb7433a1259ec39
parent 688047 2705b58446f0407a4b00b901beadda73066e7e7d
child 688049 fec77c4f2ed0b4763105d7f6d26dc2ba6883c9e4
push id86650
push usergszorc@mozilla.com
push dateSat, 28 Oct 2017 01:33:47 +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
@@ -1087,39 +1087,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)