-
Notifications
You must be signed in to change notification settings - Fork 563
[macOS] Add Architecture Priority to Info.plist #3727
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
This allows the app bundle to be launched natively on Arm without the need for Rosetta.
nit: I would also get rid of Shipwright/soh/macosx/soh-macos.sh.in Lines 251 to 257 in 2cb3a36
As (if this works) forcing a specific architecture with |
Shouldn't be necessary now...
You removed the arch stuff but didn't retain opening the actual soh binary |
Accidentally removed launching the binary from the script.
Are the binaries uploaded anywhere for testing, or should I build and test locally? (I have a Rosetta-free Apple Silicon Mac to test the changes on). |
Binaries are in the PR description. I tested on my M1 with rosetta installed and it seemed to have the "Open with Rosetta" toggle automatically checked in the .app "Get Info" after downloading/extracting (unless macOS carried this over from the previous app install). |
I got that too, but if I toggle it off, delete the builds and redownload then the option is off. So it might be from a saved setting somewhere... Edit: The preferences are saved in |
Confirmed the following scenarios: Silicon Mac with Rosetta installed - SoH with "Open with Rosetta": ✅ Runs in Rosetta mode as expected (both the main process and the shell script/app run in the appropriate mode) Confirmed via comparing the running PIDs against |
🙈 - oops, that's embarrassing, don't know how I missed that. Silicon Mac without Rosetta installed: ✅ launches without prompting to install Rosetta (and obviously runs in native mode) |
Another useful test for those with Rosetta would be to toggle the "Open with Rosetta" option and see if it actually runs in Rosetta (as it theoretically should). Might be worth a mention in the release notes, as some may need to manually uncheck the "Open with Rosetta" option as @Archez did. |
Archez confirmed that above. I added confirmation in the OP just now. |
What I mean is to check that "force running with Rosetta" (i.e. run x86_64 binary on Apple Silicon) works as expected. I don't think anyone would ever do this, but it should work. |
From his two tests, that's what I understand the first one to be: |
I tested this on an Intel Mac, and it works fine. Ready for review. |
This allows the app bundle to be launched natively on Arm without the need for Rosetta.
On macOS, when launching an app bundle with a script (like soh does) it currently defaults to running the script with x64, though the app will actually launch using arm64. What this means is that Rosetta must be installed in order to launch the app, which is not optimal.
The solution is to add the
LSArchitecturePriority
key to the info.plist, and specify for arm64 to be run first. This will not affect Intel Macs, as if the first on the list is not available, the next will be used.See here and here for details.
Testing:
Edit: The information came from issue #1553
Build Artifacts