Bug 1585195 - Port Bug 1562684 "[10.15][Mac] PR_GetLibraryFilePathname is returning absolute paths in MacOS Catalina" to Thunderbird; r=rjl
☠☠ backed out by ff690144001a ☠ ☠
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 01 Oct 2019 12:13:50 +1300
changeset 37029 4cf8a65eeb2468e4cdb72d311ac98eb50d34a00b
parent 37028 294799e8fb78f58f33df298f152f6755904b6dfb
child 37030 ff690144001a935394fae300e92359394b71759a
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersrjl
bugs1585195, 1562684
Bug 1585195 - Port Bug 1562684 "[10.15][Mac] PR_GetLibraryFilePathname is returning absolute paths in MacOS Catalina" to Thunderbird; r=rjl
mail/app/Makefile.in
mail/app/macbuild/Contents/MacOS-files-copy.in
mail/app/macbuild/Contents/MacOS-files.in
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -145,16 +145,19 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
 	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(DIST)/$(MOZ_MACBUNDLE_NAME)' --exclude English.lproj
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)'
 	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)'
 	sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Info.plist.in > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist'
 	sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)/InfoPlist.strings'
 	rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources'
 	rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
+	# MacOS-files-copy.in is a list of files that should be copies rather
+	# than symlinks and placed in .app/Contents/MacOS.
+	rsync -aL --include-from='$(srcdir)/macbuild/Contents/MacOS-files-copy.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS'
 	$(RM) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(MOZ_APP_NAME)'
 	rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
 	rsync -a --copy-unsafe-links $(DIST)/package/thunderbird.mdimporter '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
 	cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/thunderbird.icns '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/thunderbird.icns'
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
 ifdef MOZ_UPDATER
 	mv -f '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
new file mode 100644
--- /dev/null
+++ b/mail/app/macbuild/Contents/MacOS-files-copy.in
@@ -0,0 +1,11 @@
+# Specifies files that should be copied (via deep copy, resolving symlinks)
+# from dist/bin to the .app/Contents/MacOS directory. Linking is preferred to
+# reduce disk I/O during builds, so just include dylibs which need to be in the
+# same directory as returned by dladddr(3).
+#
+# Some of these dylibs load other dylibs which are assumed to be siblings in
+# the same directory obtained from dladdr(3). With macOS 10.15, dladdr returns
+# absolute resolved paths which breaks this assumption if symlinks are used
+# because the symlink targets are in different directories. Hence the need for
+# them to be copied to the same directory.
+/*.dylib
--- a/mail/app/macbuild/Contents/MacOS-files.in
+++ b/mail/app/macbuild/Contents/MacOS-files.in
@@ -1,9 +1,8 @@
 /*.app/***
-/*.dylib
 /certutil
 /thunderbird-bin
 /pingsender
 /pk12util
 /ssltunnel
 /xpcshell
 /XUL