diff --git a/build/moz.configure/android-sdk.configure b/build/moz.configure/android-sdk.configure index 129c11525a9a..fac3881ecb1b 100644 --- a/build/moz.configure/android-sdk.configure +++ b/build/moz.configure/android-sdk.configure @@ -46,8 +46,8 @@ def android_sdk_root(value): ) -@depends("--help") -def android_sdk_version(_): +@dependable +def android_sdk_version(): return namespace(build_tools_version="29.0.3", target_sdk_version="29") diff --git a/build/moz.configure/arm.configure b/build/moz.configure/arm.configure index 2082fa640f49..3b755e27db9a 100644 --- a/build/moz.configure/arm.configure +++ b/build/moz.configure/arm.configure @@ -5,8 +5,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. -@depends(target.os, "--help") -def arm_option_defaults(os, _): +@depends(target.os) +def arm_option_defaults(os): if os == "Android": arch = "armv7-a" thumb = "yes" diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 07f130608661..109a598008fe 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -10,8 +10,8 @@ option("--disable-optimize", nargs="?", help="Disable optimizations via compiler flags") -@depends("--enable-optimize", "--help") -def moz_optimize(option, _): +@depends("--enable-optimize") +def moz_optimize(option): flags = None if len(option): diff --git a/build/moz.configure/util.configure b/build/moz.configure/util.configure index fe82698c620b..8f35e89c73e2 100644 --- a/build/moz.configure/util.configure +++ b/build/moz.configure/util.configure @@ -403,12 +403,6 @@ def deprecated_option(*args, **kwargs): return decorator -# from mozbuild.util import ReadOnlyNamespace as namespace -@imports(_from="mozbuild.util", _import="ReadOnlyNamespace") -def namespace(**kwargs): - return ReadOnlyNamespace(**kwargs) - - # Turn an object into an object that can be used as an argument to @depends. # The given object can be a literal value, a function that takes no argument, # or, for convenience, a @depends function. diff --git a/js/moz.configure b/js/moz.configure index f9781b1ddc81..ba48e9798273 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -168,8 +168,8 @@ option( ) -@depends("--enable-jit", "--enable-simulator", target, "--help") -def simulator(jit_enabled, simulator_enabled, target, _): +@depends("--enable-jit", "--enable-simulator", target) +def simulator(jit_enabled, simulator_enabled, target): if not jit_enabled or not simulator_enabled: return @@ -183,7 +183,7 @@ def simulator(jit_enabled, simulator_enabled, target, _): if target.cpu != "x86_64": die("The %s simulator only works on x86-64." % sim_cpu) - return namespace(**{sim_cpu: True}) + return namespace(sim_cpu=True) set_config("JS_SIMULATOR", depends_if(simulator)(lambda x: True)) diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py index e3c1f6bacd0a..1b7541fc2069 100644 --- a/python/mozbuild/mozbuild/configure/__init__.py +++ b/python/mozbuild/mozbuild/configure/__init__.py @@ -1258,6 +1258,7 @@ class ConfigureSandbox(dict): __name__=self._paths[-1] if self._paths else "", os=self.OS, log=self.log_impl, + namespace=ReadOnlyNamespace, ) if update_globals: update_globals(glob) diff --git a/python/mozbuild/mozbuild/configure/lint.py b/python/mozbuild/mozbuild/configure/lint.py index efdd2f9e53b1..157ae4c3fdcf 100644 --- a/python/mozbuild/mozbuild/configure/lint.py +++ b/python/mozbuild/mozbuild/configure/lint.py @@ -177,6 +177,8 @@ class LintSandbox(ConfigureSandbox): continue if instr.argval in self.BUILTINS: continue + if instr.argval in "namespace": + continue return True return False