commit 35e99bf18424e331244c02aaec3531abbc945aba
parent 50a34d25155fd70628ee69c7d68a2509c0e3445d
Author: Cristina Horotan <chorotan@mozilla.com>
Date: Tue, 21 Oct 2025 15:53:22 +0300
Revert "Bug 1981063 - Remove unnecessary stanzas for desktop-launcher tests. r=firefox-build-system-reviewers,cdupuis,sergesanspaille" for causing L10n bustages
This reverts commit 7c4c01f032d1fa709db86d662f629729ce74f107.
Revert "Bug 1981063 - Consistently enable desktop launcher in artifact vs. normal builds. r=firefox-build-system-reviewers,cdupuis,browser-installer-reviewers,sergesanspaille"
This reverts commit 977d1ecafcd443cdd1a52e79d668ce015bee6f7d.
Diffstat:
10 files changed, 113 insertions(+), 113 deletions(-)
diff --git a/browser/app/desktop-launcher/moz.build b/browser/app/desktop-launcher/moz.build
@@ -1,51 +1,53 @@
-# 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/.
-
-
-# Try to sort out our building/branding model into something a C
-# preprocessor can understand
-if CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/official":
- if CONFIG["MOZ_UPDATE_CHANNEL"] == "beta":
- DEFINES["MOZ_BRANDING_IS_BETA"] = 1
- else:
- DEFINES["MOZ_BRANDING_IS_OFFICIAL"] = 1
-elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/nightly":
- DEFINES["MOZ_BRANDING_IS_NIGHTLY"] = 1
-elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/aurora":
- DEFINES["MOZ_BRANDING_IS_DEVEDITION"] = 1
-else:
- DEFINES["MOZ_BRANDING_IS_UNOFFICIAL"] = 1
-
-SPHINX_TREES["/browser/desktop-launcher"] = "docs"
-
-UNIFIED_SOURCES += [
- "download_firefox.cpp",
- "file_sink.cpp",
- "find_firefox.cpp",
- "main.cpp",
- "tempfile_name.cpp",
-]
-
-OS_LIBS += [
- "advapi32",
- "rpcrt4",
- "shell32",
- "winhttp",
-]
-LOCAL_INCLUDES += [
- "/toolkit/xre",
-]
-DIST_SUBDIR = "desktop-launcher"
-TEST_DIRS += ["tests/gtest", "tests/lib"]
-LDFLAGS = ["-SUBSYSTEM:WINDOWS", "-ENTRY:wmainCRTStartup"]
-USE_STATIC_MSVCRT = True
-Program("desktop-launcher")
-DisableStlWrapping()
-DEFINES["FIREFOX_ICO"] = '"%s/%s/%s.ico"' % (
- TOPSRCDIR,
- CONFIG["MOZ_BRANDING_DIRECTORY"],
- "firefox",
-)
-
-RCINCLUDE = "desktop-launcher.rc"
+# 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/.
+
+
+# Try to sort out our building/branding model into something a C
+# preprocessor can understand
+if CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/official":
+ if CONFIG["MOZ_UPDATE_CHANNEL"] == "beta":
+ DEFINES["MOZ_BRANDING_IS_BETA"] = 1
+ else:
+ DEFINES["MOZ_BRANDING_IS_OFFICIAL"] = 1
+elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/nightly":
+ DEFINES["MOZ_BRANDING_IS_NIGHTLY"] = 1
+elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/aurora":
+ DEFINES["MOZ_BRANDING_IS_DEVEDITION"] = 1
+else:
+ DEFINES["MOZ_BRANDING_IS_UNOFFICIAL"] = 1
+
+SPHINX_TREES["/browser/desktop-launcher"] = "docs"
+
+# Only build on Windows. Don't build with MinGW, since it doesn't support WinHTTP
+if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["CC_TYPE"] == "clang-cl":
+ UNIFIED_SOURCES += [
+ "download_firefox.cpp",
+ "file_sink.cpp",
+ "find_firefox.cpp",
+ "main.cpp",
+ "tempfile_name.cpp",
+ ]
+
+ OS_LIBS += [
+ "advapi32",
+ "rpcrt4",
+ "shell32",
+ "winhttp",
+ ]
+ LOCAL_INCLUDES += [
+ "/toolkit/xre",
+ ]
+ DIST_SUBDIR = "desktop-launcher"
+ TEST_DIRS += ["tests/gtest", "tests/lib"]
+ LDFLAGS = ["-SUBSYSTEM:WINDOWS", "-ENTRY:wmainCRTStartup"]
+ USE_STATIC_MSVCRT = True
+ Program("desktop-launcher")
+ DisableStlWrapping()
+ DEFINES["FIREFOX_ICO"] = '"%s/%s/%s.ico"' % (
+ TOPSRCDIR,
+ CONFIG["MOZ_BRANDING_DIRECTORY"],
+ "firefox",
+ )
+
+ RCINCLUDE = "desktop-launcher.rc"
diff --git a/browser/app/desktop-launcher/tests/lib/desktop-launcher-test.def b/browser/app/desktop-launcher/tests/lib/desktop-launcher-test.def
@@ -0,0 +1,7 @@
+;+# 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/.
+
+LIBRARY desktop-launcher-test
+EXPORTS
+ lookupFirefoxPath
diff --git a/browser/app/desktop-launcher/tests/lib/moz.build b/browser/app/desktop-launcher/tests/lib/moz.build
@@ -1,34 +1,39 @@
-# 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/.
-
-# Try to sort out our building/branding model into something a C
-# preprocessor can understand
-if CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/official":
- if CONFIG["MOZ_UPDATE_CHANNEL"] == "beta":
- DEFINES["MOZ_BRANDING_IS_BETA"] = 1
- else:
- DEFINES["MOZ_BRANDING_IS_OFFICIAL"] = 1
-elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/nightly":
- DEFINES["MOZ_BRANDING_IS_NIGHTLY"] = 1
-elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/aurora":
- DEFINES["MOZ_BRANDING_IS_DEVEDITION"] = 1
-else:
- DEFINES["MOZ_BRANDING_IS_UNOFFICIAL"] = 1
-
-UNIFIED_SOURCES += [
- "../../download_firefox.cpp",
- "../../file_sink.cpp",
- "../../find_firefox.cpp",
- "../../main.cpp",
- "../../tempfile_name.cpp",
-]
-
-OS_LIBS += [
- "advapi32",
- "rpcrt4",
- "shell32",
- "winhttp",
-]
-
-FINAL_LIBRARY = "xul-gtest"
+# 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/.
+
+# Try to sort out our building/branding model into something a C
+# preprocessor can understand
+if CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/official":
+ if CONFIG["MOZ_UPDATE_CHANNEL"] == "beta":
+ DEFINES["MOZ_BRANDING_IS_BETA"] = 1
+ else:
+ DEFINES["MOZ_BRANDING_IS_OFFICIAL"] = 1
+elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/nightly":
+ DEFINES["MOZ_BRANDING_IS_NIGHTLY"] = 1
+elif CONFIG["MOZ_BRANDING_DIRECTORY"] == "browser/branding/aurora":
+ DEFINES["MOZ_BRANDING_IS_DEVEDITION"] = 1
+else:
+ DEFINES["MOZ_BRANDING_IS_UNOFFICIAL"] = 1
+
+# Only build on platforms that have WinHTTP.h (i.e. not mingw)
+if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["HAVE_WINHTTP_H"]:
+ UNIFIED_SOURCES += [
+ "../../download_firefox.cpp",
+ "../../file_sink.cpp",
+ "../../find_firefox.cpp",
+ "../../main.cpp",
+ "../../tempfile_name.cpp",
+ ]
+
+ OS_LIBS += [
+ "advapi32",
+ "rpcrt4",
+ "shell32",
+ "winhttp",
+ ]
+ DEFFILE = "desktop-launcher-test.def"
+ Library("desktop-launcher-test")
+ DisableStlWrapping()
+
+ FINAL_LIBRARY = "xul-gtest"
diff --git a/browser/app/moz.build b/browser/app/moz.build
@@ -77,6 +77,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
RCINCLUDE = "splash.rc"
DIRS += [
"installation_dir_layout",
+ "desktop-launcher",
"pbproxy",
"winlauncher",
]
@@ -113,11 +114,6 @@ if CONFIG["OS_ARCH"] == "WINNT":
# only enable it for processes that are not using JIT in xul.dll.
LINK_FLAGS["CETCOMPAT"] = []
-if CONFIG["DESKTOP_LAUNCHER_ENABLED"]:
- DIRS += [
- "desktop-launcher",
- ]
-
if CONFIG["OS_ARCH"] == "Darwin":
OS_LIBS += [
"-framework CoreFoundation",
diff --git a/browser/installer/Makefile.in b/browser/installer/Makefile.in
@@ -157,3 +157,7 @@ package-compare::
ifdef ENABLE_WEBDRIVER
DEFINES += -DENABLE_WEBDRIVER=1
endif
+
+ifdef HAVE_WINHTTP_H
+DEFINES += -DDESKTOP_LAUNCHER_ENABLED=1
+endif
diff --git a/browser/installer/windows/nsis/defines.nsi.in b/browser/installer/windows/nsis/defines.nsi.in
@@ -114,7 +114,8 @@
!define MOZ_MAINTENANCE_SERVICE
#endif
-#ifdef DESKTOP_LAUNCHER_ENABLED
+# Only build on platforms that have WinHTTP.h (i.e. not mingw)
+#ifdef HAVE_WINHTTP_H
!define DESKTOP_LAUNCHER_ENABLED
#endif
diff --git a/browser/moz.build b/browser/moz.build
@@ -42,6 +42,10 @@ export("DIST_SUBDIR")
# These defines are read in firefox.js
DEFINES["APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
+# We only include the desktop launcher in non-mingw Windows builds
+if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["CC_TYPE"] == "clang-cl":
+ DEFINES["DESKTOP_LAUNCHER_ENABLED"] = True
+
for cdm in CONFIG["MOZ_EME_MODULES"]:
DEFINES["MOZ_%s_EME" % cdm.upper()] = True
diff --git a/build/moz.configure/compile-checks.configure b/build/moz.configure/compile-checks.configure
@@ -92,13 +92,7 @@ def try_link(
# conditional on the value of that function.
@template
def check_header(
- header,
- language="C++",
- body="",
- flags=None,
- includes=None,
- when=None,
- onerror=lambda: None,
+ header, language="C++", flags=None, includes=None, when=None, onerror=lambda: None
):
if when is None:
when = always
@@ -111,7 +105,6 @@ def check_header(
have_header = try_compile(
includes=includes,
- body=body,
language=language,
flags=flags,
check_msg="for %s" % header,
diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure
@@ -593,6 +593,8 @@ with only_when(depends(c_compiler)(lambda c: c.type == "clang-cl")):
set_define("HAVE_SEH_EXCEPTIONS", True)
set_define("HAVE_IO_H", True)
+ set_define("HAVE_WINHTTP_H", True)
+ set_config("HAVE_WINHTTP_H", True)
def win32_subsystem_version():
return "10.0"
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
@@ -4300,17 +4300,3 @@ set_define(
True,
when=moz_debug | milestone.is_early_beta_or_earlier,
)
-
-
-# Desktop Launcher
-# ==============================================================
-with only_when(target_is_windows):
- desktop_launcher_enabled = artifact_builds | check_header(
- "winhttp.h",
- includes=["windows.h"],
- body="auto flag = WINHTTP_FLAG_SECURE_DEFAULTS",
- language="C++",
- when=~artifact_builds,
- )
- set_config("DESKTOP_LAUNCHER_ENABLED", True, when=desktop_launcher_enabled)
- set_define("DESKTOP_LAUNCHER_ENABLED", True, when=desktop_launcher_enabled)