Bug 1257136 - Allow to pass configure options from mach configure
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -36,16 +36,17 @@ from mozbuild.base import (
ObjdirMismatchException,
)
from mozpack.manifests import (
InstallManifest,
)
from mozbuild.backend import backends
+from mozbuild.shellutil import quote as shell_quote
BUILD_WHAT_HELP = '''
What to build. Can be a top-level make target or a relative directory. If
multiple options are provided, they will be built serially. Takes dependency
information from `topsrcdir/build/dumbmake-dependencies` to build additional
targets as needed. BUILDING ONLY PARTS OF THE TREE CAN RESULT IN BAD TREE
STATE. USE AT YOUR OWN RISK.
@@ -546,23 +547,27 @@ class Build(MachCommandBase):
# Ignore Exceptions in case we can't find config.status (such
# as when doing OSX Universal builds)
pass
return status
@Command('configure', category='build',
description='Configure the tree (run configure and config.status).')
- def configure(self):
+ @CommandArgument('options', default=None, nargs=argparse.REMAINDER,
+ help='Configure options')
+ def configure(self, options=None):
def on_line(line):
self.log(logging.INFO, 'build_output', {'line': line}, '{line}')
+ options = ' '.join(shell_quote(o) for o in options or ())
status = self._run_make(srcdir=True, filename='client.mk',
target='configure', line_handler=on_line, log=False,
- print_directory=False, allow_parallel=False, ensure_exit_code=False)
+ print_directory=False, allow_parallel=False, ensure_exit_code=False,
+ append_env={b'CONFIGURE_ARGS': options.encode('utf-8')})
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',