Bug 1734523 - Remove the use of MozbuildObject.mozconfig in mach_initialize. r=firefox-build-system-reviewers,mhentges

Differential Revision: https://phabricator.services.mozilla.com/D127767
This commit is contained in:
Mike Hommey
2021-10-07 21:22:19 +00:00
parent 239986a5a9
commit f0fc4081ff

View File

@@ -301,15 +301,14 @@ def initialize(topsrcdir):
# all environments should have an instance of build object. # all environments should have an instance of build object.
build = MozbuildObject.from_environment() build = MozbuildObject.from_environment()
if build is not None and hasattr(build, "mozconfig"): if build is not None and not getattr(build, "substs", {}).get(
ac_options = build.mozconfig["configure_args"] "ENABLE_TESTS"
if ac_options and "--disable-tests" in ac_options: ):
print( print(
"Tests have been disabled by mozconfig with the flag " "Tests have been disabled with --disable-tests.\n"
+ '"ac_add_options --disable-tests".\n' + "Remove the flag, and re-compile to enable tests."
+ "Remove the flag, and re-compile to enable tests." )
) sys.exit(1)
sys.exit(1)
except BuildEnvironmentNotFoundException: except BuildEnvironmentNotFoundException:
# likely automation environment, so do nothing. # likely automation environment, so do nothing.
pass pass