-
Notifications
You must be signed in to change notification settings - Fork 2
macos: launch from finder in catalina [CPP-770] #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+ clean out unnecessary files from bundle + add more information to info.plist + explicitly disable sandbox + add verbose logging to sanboxing process
@RaiBearG Can you please this out on on Mojave and Monterey? Test build is here: https://github.com/swift-nav/swift-toolbox/releases/tag/v4.0.8-macos-bundle-cleanup -- I'll test on Windows / Linux briefly @samvrlewis Could use your help with quick code review (on your Monday). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM though admittedly I'm not super clear on the Mac paths stuff
let resources = parent.join("Resources/lib"); | ||
if resources.exists() { | ||
Ok(parent.join("Resources")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What controls whether the path is Resources
or Resources/lib
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is basically tweaking the heuristic that's used to detect if we're living inside of a macOS .app bundle -- before I was trying to use just "resources" but the heuristic was triggered when running a build from "py39-dist". The PYTHONHOME var wants a path that contains a "lib" directory (technically lib/python3.9
) so we have to supply just the "Resources" path so that Python loads correctly.
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://github.com/mherrmann/fbs/blob/d6dbde2bdff01907c4b83524f67a38df83fa0f2c/fbs/_defaults/src/freeze/mac/Contents/Info.plist looks like we're missing
<key>LSBackgroundOnly</key>
<string>0</string>
and
<!-- Enable Retina support on OS X: -->
<key>NSPrincipalClass</key>
<string>NSApplication</string>
Were these intentionally skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These looked like they could potentially change the behavior of the app (based on naming, didn't look up the docs), so I skipped them intentionally-- the new keys I did add felt more like metadata.
@RaiBearG just need to know if this launches on Mojave and Monterey-- I've went ahead and merged, but please let me know if there are issues |
Jira: https://swift-nav.atlassian.net/browse/CPP-770
Test installer build: https://github.com/swift-nav/swift-toolbox/releases/tag/v4.0.8-macos-bundle-cleanup
Clean out out the
MacOS
directory so that only the executable for the app is there, this is enabled by tweaking the loader paths for the linked Python libraries -- the use of@executable_path
in the link line is supposedly not allowed according to https://developer.apple.com/forums/thread/129795Increase verbosity of the signing / notarization process
Add more
Info.plist
keys to try to fix launch errors, pulling in keys fromfbs
: https://github.com/mherrmann/fbs/blob/master/fbs/_defaults/src/freeze/mac/Contents/Info.plistAt least one reference online suggested that assigning a bundle ID in the
Info.plist
resolved issues with launching viaopen
on CatalinaTry to clean up a few more things inside the .app before we sign and notarize