Skip to content

Commit

Permalink
Bug 1890764 - Backout macOS framework changes from Firefox 125. a=RyanVM
Browse files Browse the repository at this point in the history
Backed out changeset 937a51dbe70c (bug 1883775)
Backed out changeset d88ec0d14b41 (bug 1883123)
Backed out changeset 49cc33ed1599 (bug 1883123)
Backed out changeset b6dff3a3d41b (bug 1882228)
Backed out changeset 62677f25e495 (bug 1881662)
Backed out changeset ac4d7c08648c (bug 1881635)
Backed out changeset 3157eece201c (bug 1881360)
Backed out changeset c676fc5d89bc (bug 1848414)
Backed out changeset 5c6748ef5865 (bug 1848414)
Backed out changeset 672c3f18cb8b (bug 1848414)
Backed out changeset 2f4044201b9a (bug 1848414)
Backed out changeset ff5f23856542 (bug 1848414)
Backed out changeset f81e80cf062f (bug 1848414)
Backed out changeset d711a830a93e (bug 1848414)
Backed out changeset 62ab286ed401 (bug 1848414)
Backed out changeset 24143ec374ff (bug 1854868)
Backed out changeset 9c11a87d38fc (bug 1854868)
Backed out changeset d7341669eb0b (bug 1854868)
Backed out changeset b9753f244f18 (bug 1854868)
Backed out changeset 1e094e3ca992 (bug 1799332)
Backed out changeset 62d28922bd23 (bug 1799332)
Backed out changeset c7aa9b74be01 (bug 1799332)
Backed out changeset d8dd28c68304 (bug 1799332)
Backed out changeset a50eb05b0b0b (bug 1799332)
Backed out changeset 21e9f01c0021 (bug 1882322)

Differential Revision: https://phabricator.services.mozilla.com/D207508
  • Loading branch information
ncalexan committed Apr 16, 2024
1 parent 9c307d1 commit bd7e0ac
Show file tree
Hide file tree
Showing 88 changed files with 278 additions and 1,076 deletions.
14 changes: 5 additions & 9 deletions browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,14 @@ endif

endif

ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))

# channel-prefs.js has been removed on macOS.
# channel-prefs.js is handled separately from other prefs due to bug 756325.
# channel-prefs.js is handled separate from other prefs due to bug 756325
# DO NOT change the content of channel-prefs.js without taking the appropriate
# steps. See bug 1431342.
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(call py_action,preprocessor channel-prefs.js,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)

else
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)

Expand All @@ -84,7 +81,7 @@ MAC_BUNDLE_VERSION = $(shell $(PYTHON3) $(srcdir)/macversion.py --version=$(MOZ_

.PHONY: repackage
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-files.txt
rm -rf '$(dist_dest)'
rm -rf $(dist_dest)
$(MKDIR) -p '$(dist_dest)/Contents/MacOS'
$(MKDIR) -p '$(dist_dest)/$(LPROJ)'
rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(dist_dest)' --exclude English.lproj
Expand All @@ -102,9 +99,8 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-
cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
$(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER
cp -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
endif
$(MKDIR) -p '$(dist_dest)/Contents/Frameworks'
mv '$(dist_dest)/Contents/Resources/ChannelPrefs.framework' '$(dist_dest)/Contents/Frameworks'
printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo'
endif
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ const startupPhases = {
{
// bug 1541601
path: "PrfDef:channel-prefs.js",
condition: !MAC,
stat: 1,
read: 1,
close: 1,
Expand Down
7 changes: 0 additions & 7 deletions browser/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#ifdef MOZ_UPDATER
@APPNAME@/Contents/Library/LaunchServices
#endif
@APPNAME@/Contents/Frameworks
@APPNAME@/Contents/PkgInfo
@RESPATH@/firefox.icns
@RESPATH@/document.icns
Expand Down Expand Up @@ -142,11 +141,8 @@
#endif
@RESPATH@/application.ini
#ifdef MOZ_UPDATER
# update-settings.ini has been removed on macOS.
#ifndef XP_MACOSX
@RESPATH@/update-settings.ini
#endif
#endif
@RESPATH@/platform.ini
#ifndef MOZ_FOLD_LIBS
@BINPATH@/@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
Expand Down Expand Up @@ -254,13 +250,10 @@
@RESPATH@/browser/defaults/settings/main
@RESPATH@/browser/defaults/settings/security-state

# channel-prefs.js has been removed on macOS.
#ifndef XP_MACOSX
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
; Technically this is an app pref file, but we are keeping it in the original
; gre location for now.
@RESPATH@/defaults/pref/channel-prefs.js
#endif

; Background tasks-specific preferences.
; These are in the GRE location since they apply to all tasks at this time.
Expand Down
12 changes: 0 additions & 12 deletions browser/installer/removed-files.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,3 @@
@[email protected]
#endif
#endif

# channel-prefs.js has been removed on macOS.
#ifdef XP_MACOSX
@DIR_RESOURCES@defaults/pref/channel-prefs.js
@DIR_RESOURCES@defaults/pref/
@DIR_RESOURCES@defaults/
#endif

# update-settings.ini has been removed on macOS.
#ifdef XP_MACOSX
@[email protected]
#endif
5 changes: 1 addition & 4 deletions build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ if CONFIG["MOZ_APP_BASENAME"]:
)

FINAL_TARGET_FILES += ["!application.ini"]
if (
CONFIG["MOZ_WIDGET_TOOLKIT"] not in ("android", "cocoa")
and CONFIG["MOZ_UPDATER"]
):
if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android" and CONFIG["MOZ_UPDATER"]:
FINAL_TARGET_PP_FILES += ["update-settings.ini"]

GeneratedFile(
Expand Down
6 changes: 1 addition & 5 deletions config/createprecomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def get_build_entries(root_path):
if not (
rel_path_file.endswith("channel-prefs.js")
or rel_path_file.endswith("update-settings.ini")
or "/ChannelPrefs.framework/" in rel_path_file
or rel_path_file.startswith("ChannelPrefs.framework/")
or "/UpdateSettings.framework/" in rel_path_file
or rel_path_file.startswith("UpdateSettings.framework/")
or "distribution/" in rel_path_file
or rel_path_file.find("distribution/") != -1
):
rel_file_path_set.add(rel_path_file)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def tearDown(self):
os.remove(self.pref_file)
if hasattr(self, "autoconfig_file"):
os.remove(self.autoconfig_file)
if hasattr(self, "pref_file_dir_created"):
os.rmdir(self.pref_file_dir)

super(TestAutoConfig, self).tearDown()

Expand Down Expand Up @@ -50,11 +48,7 @@ def test_autoconfig(self):
self.marionette.quit()

test_dir = os.path.dirname(__file__)
self.pref_file_dir = os.path.join(self.exe_dir, "defaults", "pref")
if not os.path.exists(self.pref_file_dir):
os.makedirs(self.pref_file_dir, exist_ok=True)
self.pref_file_dir_created = True
self.pref_file = os.path.join(self.pref_file_dir, "autoconfig.js")
self.pref_file = os.path.join(self.exe_dir, "defaults", "pref", "autoconfig.js")
shutil.copyfile(os.path.join(test_dir, "autoconfig.js"), self.pref_file)
self.autoconfig_file = os.path.join(self.exe_dir, "autoconfig.cfg")
shutil.copyfile(os.path.join(test_dir, "autoconfig.cfg"), self.autoconfig_file)
Expand Down
25 changes: 0 additions & 25 deletions modules/libpref/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
# include "mozilla/WidgetUtilsGtk.h"
#endif // defined(MOZ_WIDGET_GTK)

#ifdef MOZ_WIDGET_COCOA
# include "ChannelPrefsUtil.h"
#endif

using namespace mozilla;

using ipc::FileDescriptor;
Expand Down Expand Up @@ -4848,27 +4844,6 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
NS_WARNING("Error parsing application default preferences.");
}

#ifdef MOZ_WIDGET_COCOA
// On macOS, channel-prefs.js is no longer bundled with the application and
// the "app.update.channel" pref is now read from a Framework instead.
// Previously, channel-prefs.js was read as one of the files in
// NS_APP_PREF_DEFAULTS_50_DIR (see just above). See bug 1799332 for more
// info.
nsAutoCString appUpdatePrefKey;
appUpdatePrefKey.Assign(kChannelPref);
nsAutoCString appUpdatePrefValue;
PrefValue channelPrefValue;
channelPrefValue.mStringVal = MOZ_STRINGIFY(MOZ_UPDATE_CHANNEL);
if (ChannelPrefsUtil::GetChannelPrefValue(appUpdatePrefValue)) {
channelPrefValue.mStringVal = appUpdatePrefValue.get();
}
pref_SetPref(appUpdatePrefKey, PrefType::String, PrefValueKind::Default,
channelPrefValue,
/* isSticky */ false,
/* isLocked */ true,
/* fromInit */ true);
#endif

// Load jar:$app/omni.jar!/defaults/preferences/*.js
// or jar:$gre/omni.jar!/defaults/preferences/*.js.
RefPtr<nsZipArchive> appJarReader = Omnijar::GetReader(Omnijar::APP);
Expand Down
68 changes: 28 additions & 40 deletions python/mozbuild/mozbuild/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,38 +646,26 @@ class MacArtifactJob(ArtifactJob):

# These get copied into dist/bin without the path, so "root/a/b/c" -> "dist/bin/c".
_paths_no_keep_path = (
(
"Contents/MacOS",
[
"crashreporter.app/Contents/MacOS/crashreporter",
"{product}",
"{product}-bin",
"*.dylib",
"minidump-analyzer",
"nmhproxy",
"pingsender",
"plugin-container.app/Contents/MacOS/plugin-container",
"updater.app/Contents/Frameworks/UpdateSettings.framework/UpdateSettings",
"updater.app/Contents/MacOS/org.mozilla.updater",
# 'xpcshell',
"XUL",
],
),
(
"Contents/Frameworks",
[
"ChannelPrefs.framework/ChannelPrefs",
],
),
"Contents/MacOS",
[
"crashreporter.app/Contents/MacOS/crashreporter",
"{product}",
"{product}-bin",
"*.dylib",
"minidump-analyzer",
"nmhproxy",
"pingsender",
"plugin-container.app/Contents/MacOS/plugin-container",
"updater.app/Contents/MacOS/org.mozilla.updater",
# 'xpcshell',
"XUL",
],
)

@property
def paths_no_keep_path(self):
formatted = []
for root, paths in self._paths_no_keep_path:
formatted.append((root, [p.format(product=self.product) for p in paths]))

return tuple(formatted)
root, paths = self._paths_no_keep_path
return (root, [p.format(product=self.product) for p in paths])

@contextmanager
def get_writer(self, **kwargs):
Expand Down Expand Up @@ -738,18 +726,18 @@ def process_package_artifact(self, filename, processed_filename):
]

with self.get_writer(file=processed_filename, compress_level=5) as writer:
for root, paths in self.paths_no_keep_path:
finder = UnpackFinder(mozpath.join(source, root))
for path in paths:
for p, f in finder.find(path):
self.log(
logging.DEBUG,
"artifact",
{"path": p},
"Adding {path} to processed archive",
)
destpath = mozpath.join("bin", os.path.basename(p))
writer.add(destpath.encode("utf-8"), f.open(), mode=f.mode)
root, paths = self.paths_no_keep_path
finder = UnpackFinder(mozpath.join(source, root))
for path in paths:
for p, f in finder.find(path):
self.log(
logging.DEBUG,
"artifact",
{"path": p},
"Adding {path} to processed archive",
)
destpath = mozpath.join("bin", os.path.basename(p))
writer.add(destpath.encode("utf-8"), f.open(), mode=f.mode)

for root, paths in paths_keep_path:
finder = UnpackFinder(mozpath.join(source, root))
Expand Down
6 changes: 1 addition & 5 deletions taskcluster/ci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,9 @@ mac-signing:
- deep: false
runtime: true
force: true
# These files are signed without entitlements
# These files are signed wihtout entitlements
globs:
- "/Contents/MacOS/crashreporter.app"
- "/Contents/MacOS/updater.app/Contents/Frameworks/UpdateSettings.framework"
- "/Contents/MacOS/updater.app"
- "/Contents/Library/LaunchServices/org.mozilla.updater"
- "/Contents/MacOS/XUL"
Expand All @@ -802,7 +801,6 @@ mac-signing:
- "/Contents/MacOS/nmhproxy"
- "/Contents/MacOS/*.dylib"
- "/Contents/Resources/gmp-clearkey/*/*.dylib"
- "/Contents/Frameworks/ChannelPrefs.framework"

- deep: false
runtime: true
Expand Down Expand Up @@ -838,13 +836,11 @@ mac-signing:
entitlements: security/mac/hardenedruntime/v2/developer/utility.xml
globs:
- "/Contents/MacOS/crashreporter.app"
- "/Contents/MacOS/updater.app/Contents/Frameworks/UpdateSettings.framework"
- "/Contents/MacOS/updater.app"
- "/Contents/Library/LaunchServices/org.mozilla.updater"
- "/Contents/MacOS/pingsender"
- "/Contents/MacOS/minidump-analyzer"
- "/Contents/MacOS/nmhproxy"
- "/Contents/Frameworks/ChannelPrefs.framework"

- deep: false
runtime: true
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/ci/diffoscope/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ job-defaults:
# artifact and not-artifact builds, so remove its line if present.
- sed -i '/telemetry\.fog\.artifact\_build/d' b/"$RESOURCE_DIR"/browser/defaults/preferences/firefox.js
# artifact builds are not fed with accepted-mar-channel-ids
- if [ -f a/"$RESOURCE_DIR"/update-settings.ini ]; then sed -i '/ACCEPTED_MAR_CHANNEL_IDS/d' {a,b}/"$RESOURCE_DIR"/update-settings.ini; fi
- sed -i '/ACCEPTED_MAR_CHANNEL_IDS/d' {a,b}/"$RESOURCE_DIR"/update-settings.ini
# Extra diffoscope arguments to account for:
# - about:buildconfig being expectedly different.
extra-args: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ add_task(async function test_prefs() {
"Accepting the policy again should let us upload data."
);

// macOS has the app.update.channel pref locked. Check if it needs to be
// unlocked before proceeding with the test.
if (Services.prefs.getDefaultBranch("").prefIsLocked("app.update.channel")) {
Services.prefs.getDefaultBranch("").unlockPref("app.update.channel");
}

// Set a new, per channel, minimum policy version. Start by setting a test current channel.
Services.prefs
.getDefaultBranch("")
Expand Down
4 changes: 0 additions & 4 deletions toolkit/library/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def Libxul(name, output_category=None):
LDFLAGS += ["-Wl,-U,_OBJC_CLASS_$_NSCustomTouchBarItem"]
LDFLAGS += ["-Wl,-U,_OBJC_CLASS_$_NSPopoverTouchBarItem"]
LDFLAGS += ["-lresolv"]
LDFLAGS += ["-Wl,-rpath,@executable_path/../Frameworks/ChannelPrefs.framework"]

if CONFIG["MOZ_DEBUG_SYMBOLS"] and CONFIG["CC_TYPE"] == "clang-cl":
LDFLAGS += ["-NATVIS:%s/toolkit/library/gecko.natvis" % TOPSRCDIR]
Expand Down Expand Up @@ -233,9 +232,6 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
"-framework CoreSymbolication",
"cups",
]
USE_LIBS += [
"ChannelPrefs",
]

if CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
OS_LIBS += [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ add_task(async function test_updatechannel() {
Assert.equal(UpdateUtils.getUpdateChannel(true), currentChannel);
Assert.equal(UpdateUtils.getUpdateChannel(false), currentChannel);

defaultPrefs.unlock(PREF_APP_UPDATE_CHANNEL);
defaultPrefs.set(PREF_APP_UPDATE_CHANNEL, TEST_CHANNEL);
Assert.equal(UpdateUtils.UpdateChannel, TEST_CHANNEL);
Assert.equal(UpdateUtils.getUpdateChannel(true), TEST_CHANNEL);
Expand Down
1 change: 0 additions & 1 deletion toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const gAppInfo = getAppInfo();
const gDefaultPrefBranch = Services.prefs.getDefaultBranch(null);

function setUpdateChannel(aChannel) {
gDefaultPrefBranch.unlockPref(PREF_APP_UPDATE_CHANNEL);
gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, aChannel);
}

Expand Down
1 change: 0 additions & 1 deletion toolkit/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
DIRS += ["system/unixproxy"]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
DIRS += [
"mozapps/macos-frameworks",
"system/commonproxy",
"system/osxproxy",
]
Expand Down
17 changes: 0 additions & 17 deletions toolkit/mozapps/macos-frameworks/ChannelPrefs/ChannelPrefs.h

This file was deleted.

12 changes: 0 additions & 12 deletions toolkit/mozapps/macos-frameworks/ChannelPrefs/ChannelPrefs.mm

This file was deleted.

Loading

0 comments on commit bd7e0ac

Please sign in to comment.