Bug 1275419 - Deprecate --enable-build-backend and add --build-backends. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 25 May 2016 16:23:51 +0900
changeset 299126 27108dad917e666a72ba384ac2311217158aa0c2
parent 299125 429f5a3ae4badce551053d5697914d710301233e
child 299127 65806002153d3ede2fab5d77c466926a56de160e
push id77448
push usermh@glandium.org
push dateThu, 26 May 2016 12:30:58 +0000
treeherdermozilla-inbound@27108dad917e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1275419 - Deprecate --enable-build-backend and add --build-backends. r=chmanchester --enable-build-backend was taking a list of additional backends to add to the defaults. Changes to allow to disable some of the defaults is not possible in a straightforward way, so introduce a new --build-backends option that sets the exact set of wanted backends, but also allows to add and remove from the defaults with + or -. --build-backends=+CompileDB is equivalent to --enable-build-backend=CompileDB. --build-backends=-VisualStudio disables the VS backend when it's automatically enabled.
--- a/moz.configure
+++ b/moz.configure
@@ -101,32 +101,47 @@ include(memory_include)
 @imports(_from='mozbuild.backend', _import='backends')
 def build_backends_choices(help):
     return tuple(backends)
-option('--enable-build-backend', nargs='+', choices=build_backends_choices,
-       help='Enable additional build backends')
+@deprecated_option('--enable-build-backend', nargs='+',
+                   choices=build_backends_choices)
+def build_backend(backends):
+    if backends:
+        return tuple('+%s' % b for b in backends)
-@depends('--enable-build-backend', '--enable-artifact-builds', target,
-         compile_environment)
-def build_backend(backends, artifact_builds, target, compile_environment):
+imply_option('--build-backends', build_backend)
+@depends('--enable-artifact-builds', '--disable-compile-environment', '--help')
+def build_backend_defaults(artifact_builds, compile_environment, _):
     if artifact_builds:
         all_backends = ['FasterMake+RecursiveMake']
         all_backends = ['RecursiveMake', 'FasterMake']
-    if target.os == 'WINNT' and compile_environment:
+    # Normally, we'd use target.os == 'WINNT', but a dependency on target
+    # would require target to depend on --help, as well as host and shell,
+    # and this is not a can of worms we can open at the moment.
+    if sys.platform == 'win32' and compile_environment:
-    all_backends.extend(backends)
-    return unique_list(all_backends)
+    return tuple(all_backends)
+option('--build-backends', nargs='+', default=build_backend_defaults,
+       choices=build_backends_choices, help='Build backends to generate')
-set_config('BUILD_BACKENDS', build_backend)
+def build_backends(backends):
+    return backends
+set_config('BUILD_BACKENDS', build_backends)
 # Awk detection
 # ==============================================================
 awk = check_prog('AWK', ('gawk', 'mawk', 'nawk', 'awk'))
 # Until the AWK variable is not necessary in old-configure