From 42eadf3cbf123ac17c4558d3a15ed5ff9eacd314 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Mon, 17 Jun 2024 07:45:19 +0000 Subject: [PATCH] Bug 1900275 - Move MOZ_STUB_INSTALLER from confvars.sh to moz.configure r=glandium Differential Revision: https://phabricator.services.mozilla.com/D212388 --- browser/confvars.sh | 20 -------------------- browser/moz.configure | 28 ++++++++++++++++++++++++++++ old-configure.in | 2 -- toolkit/moz.configure | 8 ++++++++ 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/browser/confvars.sh b/browser/confvars.sh index 50ecebec4c05..6c27951bfaf5 100755 --- a/browser/confvars.sh +++ b/browser/confvars.sh @@ -3,26 +3,6 @@ # 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/. -if test "$OS_ARCH" = "WINNT"; then - if ! test "$HAVE_64BIT_BUILD"; then - if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \ - "$MOZ_UPDATE_CHANNEL" = "nightly-try" -o \ - "$MOZ_UPDATE_CHANNEL" = "aurora" -o \ - "$MOZ_UPDATE_CHANNEL" = "beta" -o \ - "$MOZ_UPDATE_CHANNEL" = "release"; then - if ! test "$MOZ_DEBUG"; then - if ! test "$USE_STUB_INSTALLER"; then - # Expect USE_STUB_INSTALLER from taskcluster for downstream task consistency - echo "ERROR: STUB installer expected to be enabled but" - echo "ERROR: USE_STUB_INSTALLER is not specified in the environment" - exit 1 - fi - MOZ_STUB_INSTALLER=1 - fi - fi - fi -fi - # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is # specified. It should never point to the "official" branding directory. diff --git a/browser/moz.configure b/browser/moz.configure index ef00fe37c4a1..e605019172ad 100644 --- a/browser/moz.configure +++ b/browser/moz.configure @@ -24,4 +24,32 @@ with only_when(target_has_linux_kernel & compile_environment): set_config("MOZ_NO_PIE_COMPAT", depends_if("MOZ_NO_PIE_COMPAT")(lambda _: True)) + +@depends(target, update_channel, have_64_bit, moz_debug, "MOZ_AUTOMATION") +@imports(_from="os", _import="environ") +def requires_stub_installer( + target, update_channel, have_64_bit, moz_debug, moz_automation +): + if target.kernel != "WINNT": + return False + if have_64_bit: + return False + if update_channel not in ("nightly", "nightly-try", "aurora", "beta", "release"): + return False + + if moz_debug: + return False + + # Expect USE_STUB_INSTALLER from taskcluster for downstream task consistency + if moz_automation and not environ.get("USE_STUB_INSTALLER"): + die( + "STUB installer expected to be enabled but " + "USE_STUB_INSTALLER is not specified in the environment" + ) + + return True + + +imply_option("MOZ_STUB_INSTALLER", True, when=requires_stub_installer) + include("../toolkit/moz.configure") diff --git a/old-configure.in b/old-configure.in index 24510d839012..5a595f296ae1 100644 --- a/old-configure.in +++ b/old-configure.in @@ -625,8 +625,6 @@ dnl ======================================================== AC_SUBST_LIST(ASFLAGS) AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS) -AC_SUBST(MOZ_STUB_INSTALLER) - AC_SUBST_LIST(MOZ_FIX_LINK_PATHS) dnl ======================================================== diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 69d268b09e6a..9e2f3b5b7955 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -41,6 +41,14 @@ project_flag( help="which devtools version should be built", ) + +option( + env="MOZ_STUB_INSTALLER", + help="produce a stub installer", +) +set_config("MOZ_STUB_INSTALLER", True, when="MOZ_STUB_INSTALLER") + + project_flag( env="MOZ_PROFILE_MIGRATOR", help="enable profile migrator",