Bug 1734754 - 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-12 04:05:32 +00:00
parent c61b9d3ae7
commit c1bd50d07c

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(
ac_options = build.mozconfig["configure_args"] build, "substs", {"ENABLE_TESTS": True}
if ac_options and "--disable-tests" in ac_options: ).get("ENABLE_TESTS"):
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