diff --git a/build/moz.configure/bootstrap.configure b/build/moz.configure/bootstrap.configure --- a/build/moz.configure/bootstrap.configure +++ b/build/moz.configure/bootstrap.configure @@ -102,11 +102,11 @@ @depends( "--enable-bootstrap", toolchains_base_dir, bootstrap_toolchain_tasks, shell, - check_build_environment, + build_environment, dependable(path), when=when, ) @imports("os") @imports("subprocess") diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure --- a/build/moz.configure/init.configure +++ b/build/moz.configure/init.configure @@ -15,11 +15,11 @@ option(env="DIST", nargs=1, help="DIST directory") @depends("--help", "DIST") -def check_build_environment(_, dist): +def build_environment(_, dist): topobjdir = os.path.realpath(".") topsrcdir = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) if dist: dist = normsep(dist[0]) @@ -31,17 +31,17 @@ topobjdir=topobjdir, dist=dist, ) -set_config("TOPSRCDIR", check_build_environment.topsrcdir) -set_config("TOPOBJDIR", check_build_environment.topobjdir) -set_config("DIST", check_build_environment.dist) +set_config("TOPSRCDIR", build_environment.topsrcdir) +set_config("TOPOBJDIR", build_environment.topobjdir) +set_config("DIST", build_environment.dist) -add_old_configure_assignment("_topsrcdir", check_build_environment.topsrcdir) -add_old_configure_assignment("_objdir", check_build_environment.topobjdir) -add_old_configure_assignment("DIST", check_build_environment.dist) +add_old_configure_assignment("_topsrcdir", build_environment.topsrcdir) +add_old_configure_assignment("_objdir", build_environment.topobjdir) +add_old_configure_assignment("DIST", build_environment.dist) option(env="MOZ_AUTOMATION", help="Enable options for automated builds") set_config("MOZ_AUTOMATION", depends_if("MOZ_AUTOMATION")(lambda x: True)) @@ -55,11 +55,11 @@ # Note: the dependency on --help is only there to always read the mozconfig, # even when --help is passed. Without this dependency, the function wouldn't # be called when --help is passed, and the mozconfig wouldn't be read. -@depends("MOZCONFIG", "OLD_CONFIGURE", check_build_environment, "--help") +@depends("MOZCONFIG", "OLD_CONFIGURE", build_environment, "--help") @imports(_from="mozbuild.mozconfig", _import="MozconfigLoader") @imports(_from="mozboot.mozconfig", _import="find_mozconfig") def mozconfig(mozconfig, old_configure, build_env, help): if not old_configure and not help: die("The OLD_CONFIGURE environment variable must be set") @@ -219,21 +219,21 @@ add(key, value) for key, (_, value) in six.iteritems(mozconfig["vars"]["modified"]): add(key, value) -@depends(check_build_environment, "--help") +@depends(build_environment, "--help") @imports(_from="os.path", _import="exists") def js_package(build_env, help): return not exists(os.path.join(build_env.topsrcdir, "browser")) # Source checkout and version control integration. # ================================================ -@depends(check_build_environment, "MOZ_AUTOMATION", js_package, "--help") +@depends(build_environment, "MOZ_AUTOMATION", js_package, "--help") @checking("for vcs source checkout") @imports("os") def vcs_checkout_type(build_env, automation, js_package, help): if os.path.exists(os.path.join(build_env.topsrcdir, ".hg")): return "hg" @@ -294,11 +294,11 @@ # Resolve Mercurial config items so other checks have easy access. # Do NOT set this in the config because it may contain sensitive data # like API keys. -@depends_all(check_build_environment, hg, hg_version) +@depends_all(build_environment, hg, hg_version) @imports("os") def hg_config(build_env, hg, version): env = dict(os.environ) env["HGPLAIN"] = "1" @@ -357,11 +357,11 @@ set_config("VCS_CHECKOUT_TYPE", exposed_vcs_checkout_type) # Obtain a Repository interface for the current VCS repository. -@depends(check_build_environment, exposed_vcs_checkout_type, hg, git) +@depends(build_environment, exposed_vcs_checkout_type, hg, git) @imports(_from="mozversioncontrol", _import="get_repository_object") def vcs_repository(build_env, vcs_checkout_type, hg, git): if vcs_checkout_type == "hg": return get_repository_object(build_env.topsrcdir, hg=hg) elif vcs_checkout_type == "git": @@ -395,11 +395,11 @@ imply_option("--enable-project", application) -@depends(check_build_environment, js_package) +@depends(build_environment, js_package) def default_project(build_env, js_package): if js_package or build_env.topobjdir.endswith("/js/src"): return "js" return "browser" @@ -886,11 +886,11 @@ set_define("SPARC64", target_is_sparc) -@depends("--enable-project", check_build_environment, "--help") +@depends("--enable-project", build_environment, "--help") @imports(_from="os.path", _import="exists") def include_project_configure(project, build_env, help): if not project: die("--enable-project is required.") @@ -942,11 +942,11 @@ # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in # The logic works like this: # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD) # - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA) -@depends(check_build_environment, build_project, version_path, "--help") +@depends(build_environment, build_project, version_path, "--help") @imports(_from="__builtin__", _import="open") @imports("os") @imports("re") def milestone(build_env, build_project, version_path, _): versions = [] diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure --- a/build/moz.configure/lto-pgo.configure +++ b/build/moz.configure/lto-pgo.configure @@ -53,11 +53,11 @@ @depends( "--with-pgo-profile-path", "--enable-profile-use", llvm_profdata, - check_build_environment, + build_environment, ) @imports("os") def pgo_profile_path(path, pgo_use, profdata, build_env): topobjdir = build_env.topobjdir if topobjdir.endswith("/js/src"): diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure --- a/build/moz.configure/nspr.configure +++ b/build/moz.configure/nspr.configure @@ -82,11 +82,11 @@ set_config("PKGCONF_REQUIRES_PRIVATE", pkgconf_requires_private) # pkg_check_modules takes care of NSPR_CFLAGS and NSPR_LIBS when using --with-system-nspr. -@depends(check_build_environment, c_compiler, fold_libs, when=build_nspr) +@depends(build_environment, c_compiler, fold_libs, when=build_nspr) def nspr_config(build_env, c_compiler, fold_libs): libs = ["nspr4", "plc4", "plds4"] if c_compiler.type == "clang-cl": lib_dir = os.path.join(build_env.dist, "lib") libs = [os.path.join(lib_dir, "%s.lib" % lib) for lib in libs] diff --git a/build/moz.configure/nss.configure b/build/moz.configure/nss.configure --- a/build/moz.configure/nss.configure +++ b/build/moz.configure/nss.configure @@ -13,11 +13,11 @@ ) set_config("MOZ_SYSTEM_NSS", True, when="--with-system-nss") -@depends(nss_pkg, check_build_environment) +@depends(nss_pkg, build_environment) def nss_config(nss_pkg, build_env): cflags = ["-I%s" % os.path.join(build_env.dist, "include", "nss")] libs = None if nss_pkg: cflags = list(nss_pkg.cflags) + cflags diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -125,11 +125,11 @@ @depends( prepare_configure, prepare_configure_options, altered_path, extra_env, - check_build_environment, + build_environment, old_configure_path, "MOZILLABUILD", awk, m4, shell, diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -529,11 +529,11 @@ @depends( host, vs_major_version, - check_build_environment, + build_environment, "VC_PATH", "--with-visual-studio-version", when=host_is_windows, ) @imports(_from="operator", _import="itemgetter") @@ -1653,11 +1653,11 @@ set_define("_LIBCPP_ALWAYS_INLINE", libcxx_override_visibility.empty) set_define("_LIBCPP_HIDE_FROM_ABI", libcxx_override_visibility.hide_from_abi) -@depends(target, check_build_environment) +@depends(target, build_environment) def visibility_flags(target, env): if target.os != "WINNT": if target.kernel == "Darwin": return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") return ( @@ -2065,11 +2065,11 @@ set_config("MOZ_CODE_COVERAGE", code_coverage) set_define("MOZ_CODE_COVERAGE", code_coverage) -@depends(target, c_compiler, check_build_environment, when=code_coverage) +@depends(target, c_compiler, build_environment, when=code_coverage) @imports("os") @imports("re") @imports(_from="__builtin__", _import="open") def coverage_cflags(target, c_compiler, build_env): cflags = ["--coverage"] @@ -2840,11 +2840,11 @@ return [] @depends( target, - check_build_environment, + build_environment, target_sysroot.path, valid_windows_sdk_dir, vc_path, when="--enable-path-remapping", ) diff --git a/js/moz.configure b/js/moz.configure --- a/js/moz.configure +++ b/js/moz.configure @@ -1113,11 +1113,11 @@ set_config("JS_HAS_INTL_API", True, when="--with-intl-api") set_define("JS_HAS_INTL_API", True, when="--with-intl-api") -@depends(check_build_environment, when="--with-intl-api") +@depends(build_environment, when="--with-intl-api") @imports(_from="__builtin__", _import="open") @imports(_from="__builtin__", _import="ValueError") def icu_version(build_env): path = os.path.join( build_env.topsrcdir, "intl", "icu", "source", "common", "unicode", "uvernum.h" diff --git a/js/sub.configure b/js/sub.configure --- a/js/sub.configure +++ b/js/sub.configure @@ -3,11 +3,11 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -@depends(check_build_environment) +@depends(build_environment) @imports("logging") @imports(_from="__builtin__", _import="object") @imports(_from="mozbuild.configure.util", _import="ConfigureOutputHandler") def old_js_configure(build_env): class PrefixOutput(object): diff --git a/mobile/android/gradle.configure b/mobile/android/gradle.configure --- a/mobile/android/gradle.configure +++ b/mobile/android/gradle.configure @@ -26,11 +26,11 @@ if value: return True -@depends(host, "--with-gradle", check_build_environment) +@depends(host, "--with-gradle", build_environment) @imports(_from="os.path", _import="isfile") def gradle(host, value, build_env): if len(value): gradle = value[0] else: diff --git a/moz.configure b/moz.configure --- a/moz.configure +++ b/moz.configure @@ -404,11 +404,11 @@ set_config("BUILD_BACKENDS", build_backends) -@depends(check_build_environment, build_backends) +@depends(build_environment, build_backends) @imports("glob") def check_objdir_backend_reuse(build_env, backends): # "Make based" might be RecursiveMake or a hybrid backend, so "Make" is # intentionally vague for use with the substring match below. incompatible_backends = (("Tup", "Make"), ("Make", "Tup")) @@ -475,11 +475,11 @@ # clang-plugin location # ============================================================== -@depends(host_library_name_info, check_build_environment, when="--enable-clang-plugin") +@depends(host_library_name_info, build_environment, when="--enable-clang-plugin") def clang_plugin_path(library_name_info, build_env): topobjdir = build_env.topobjdir if topobjdir.endswith("/js/src"): topobjdir = topobjdir[:-7] return os.path.abspath( @@ -932,11 +932,11 @@ # JS Subconfigure. include("js/sub.configure", when=compile_environment & toolkit) -@depends(check_build_environment, build_project) +@depends(build_environment, build_project) @imports("__sandbox__") @imports("glob") @imports(_from="os.path", _import="exists") def config_status_deps(build_env, build_project): diff --git a/toolkit/moz.configure b/toolkit/moz.configure --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -239,11 +239,11 @@ # L10N # ============================================================== option("--with-l10n-base", nargs=1, env="L10NBASEDIR", help="Path to l10n repositories") -@depends("--with-l10n-base", "MOZ_AUTOMATION", check_build_environment) +@depends("--with-l10n-base", "MOZ_AUTOMATION", build_environment) @imports(_from="os.path", _import="isdir") @imports(_from="os.path", _import="expanduser") @imports(_from="os", _import="environ") def l10n_base(value, automation, build_env): if value: @@ -976,11 +976,11 @@ set_define("HAVE_FT_BITMAP_SIZE_Y_PPEM", tree_freetype) set_define("HAVE_FT_GLYPHSLOT_EMBOLDEN", tree_freetype) set_define("HAVE_FT_LOAD_SFNT_TABLE", tree_freetype) -@depends(freetype2_combined_info, tree_freetype, check_build_environment) +@depends(freetype2_combined_info, tree_freetype, build_environment) def ft2_info(freetype2_combined_info, tree_freetype, build_env): if tree_freetype: return namespace( cflags=("-I%s/modules/freetype2/include" % build_env.topsrcdir,), libs=() ) @@ -1258,11 +1258,11 @@ ) set_config("USE_ELF_HACK", depends_if("--enable-elf-hack")(lambda _: True)) -@depends(check_build_environment) +@depends(build_environment) def idl_roots(build_env): return namespace( ipdl_root=os.path.join(build_env.topobjdir, "ipc", "ipdl"), webidl_root=os.path.join(build_env.topobjdir, "dom", "bindings"), xpcom_root=os.path.join(build_env.topobjdir, "xpcom", "components"),