--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -992,19 +992,18 @@ class BuildDriver(MozbuildObject):
target is used.
"""
warnings_path = self._get_state_filename('warnings.json')
monitor = self._spawn(BuildMonitor)
monitor.init(warnings_path)
ccache_start = monitor.ccache_stats()
footer = BuildProgressFooter(self.log_manager.terminal, monitor)
- # Disable indexing in objdir because it is not necessary and can slow
- # down builds.
- mkdir(self.topobjdir, not_indexed=True)
+ if self._prepare_objdir():
+ return 1
with BuildOutputManager(self.log_manager, monitor, footer) as output:
monitor.start()
if directory is not None and not what:
print('Can only use -C/--directory with an explicit target '
'name.')
return 1
@@ -1269,19 +1268,18 @@ class BuildDriver(MozbuildObject):
# 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):
- # Disable indexing in objdir because it is not necessary and can slow
- # down builds.
- mkdir(self.topobjdir, not_indexed=True)
+ if self._prepare_objdir():
+ return 1
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')}
@@ -1312,27 +1310,30 @@ class BuildDriver(MozbuildObject):
# If we don't actually have a list of tests to install we install
# test and support files wholesale.
self._run_make(target='install-test-files', pass_thru=True,
print_directory=False)
else:
install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir,
'_tests', test_objs)
- def _run_client_mk(self, target=None, line_handler=None, jobs=0,
- verbose=None, keep_going=False, append_env=None):
- append_env = dict(append_env or {})
- append_env['TOPSRCDIR'] = self.topsrcdir
+ def _prepare_objdir(self):
+ """Prepare the objdir for performing a build.
- append_env['CONFIG_GUESS'] = self.resolve_config_guess()
-
+ This essentially puts things into place that allow us to invoke
+ client.mk.
+ """
mozconfig = self.mozconfig
if self._check_clobber(mozconfig, os.environ):
- return 1
+ return True
+
+ # Disable indexing in objdir because it is not necessary and can slow
+ # down builds.
+ mkdir(self.topobjdir, not_indexed=True)
mozconfig_make_lines = []
for arg in mozconfig['make_extra'] or []:
mozconfig_make_lines.append(arg)
if mozconfig['make_flags']:
mozconfig_make_lines.append(b'MOZ_MAKE_FLAGS=%s' %
b' '.join(mozconfig['make_flags']))
@@ -1380,16 +1381,21 @@ class BuildDriver(MozbuildObject):
raise
if mozconfig_make_lines:
self.log(logging.WARNING, 'mozconfig_content', {
'path': mozconfig['path'],
'content': '\n '.join(mozconfig_make_lines),
}, 'Adding make options from {path}\n {content}')
+ def _run_client_mk(self, target=None, line_handler=None, jobs=0,
+ verbose=None, keep_going=False, append_env=None):
+ append_env = dict(append_env or {})
+ append_env['TOPSRCDIR'] = self.topsrcdir
+ append_env['CONFIG_GUESS'] = self.resolve_config_guess()
append_env['OBJDIR'] = mozpath.normsep(self.topobjdir)
return self._run_make(srcdir=True,
filename='client.mk',
allow_parallel=False,
ensure_exit_code=False,
print_directory=False,
target=target,