-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Description
Bug report
Bug description:
Description
macOS IDLE app may be launched under Rosetta on Apple Silicon
Proposed simple fix/solution:
Add a LSArchitecturePriority key and a LSRequiresNativeExecution key to the IDLE app's Info.plist file:
<key>LSArchitecturePriority</key>
<array>
<string>arm64e</string>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>LSRequiresNativeExecution</key>
<true/>
to prevent in any case such possibly launch under Rosetta.
Software:
Python Launcher.app (3.13.6)
IDLE.app (3.13.6)
System:
% uname -m
arm64
% machine
arm64e
% /usr/bin/sw_vers
ProductName: macOS
ProductVersion: 15.6
BuildVersion: 24G84
Additional similar context concerning Script-only apps (like the IDLE app is one of):
LibreOffice Bug 156302: LibreOffice langpack installations cannot run on Apple Silicon, requires Rosetta
https://bugs.documentfoundation.org/show_bug.cgi?id=156302
LibreOffice Commit: prioritize Silicon architectures before Intel
https://git.libreoffice.org/core/+/722073473b6d8e8553f501ff1d4a68d4dc21f866%5E%21
https://apple.stackexchange.com/questions/466284/why-is-a-macos-app-whose-executable-is-a-shell-script-launching-as-x86-64-on-an
Apple Documentation
Apple Developer Documentation: Building a universal macOS binary
Create macOS apps and other executables that run natively on both Apple silicon and Intel-based Mac computers.
https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary
…
Specify the Launch Behavior of Your AppFor universal binaries, the system prefers to execute the slice that is native to the current platform. On an Intel-based Mac computer, the system always executes the x86_64 slice of the binary. On Apple silicon, the system prefers to execute the arm64 slice when one is present. Users can force the system to run the app under Rosetta translation by enabling the appropriate option from the app’s Get Info window in the Finder.
👉If you never want users to run your app under Rosetta translation, add the LSRequiresNativeExecution key to your app’s Info.plist file. When that key is present and set to YES, the system prevents your app from running under translation. In addition, the system removes the Rosetta translation option from your app’s Get Info window. Don’t include this key until you verify that your app runs correctly on both Apple silicon and Intel-based Mac computers.👈
If you want to prioritize one architecture, without preventing users from running your app under translation, add the LSArchitecturePriority key to your app’s Info.plist file. The value of this key is an ordered array of strings, which define the priority order for selecting an architecture.
Note
👉If an app doesn’t contain an executable binary, the system may run it under Rosetta translation as a precautionary measure to prevent potential runtime issues. For example, the system runs script-only apps under Rosetta translation. If you verified that your app runs correctly on both Apple silicon and Intel-based Mac computers, add the LSArchitecturePriority key to your app’s Info.plist file and list the arm64 architecture first.👈
Example:
<key>LSArchitecturePriority</key>
<array>
<string>arm64e</string>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>LSRequiresNativeExecution</key>
<true/>
Apple Documentation to the named Property List keys above:
Apple Developer Documentation: Property List Key LSArchitecturePriority
An array of the architectures that the app supports, arranged according to their preferred usage.
https://developer.apple.com/documentation/BundleResources/Information-Property-List/LSArchitecturePriority
Apple Developer Documentation: Property List Key LSRequiresNativeExecution
A Boolean value that indicates whether to require the execution of the app’s native architecture when multiple architectures are available.
https://developer.apple.com/documentation/bundleresources/information-property-list/lsrequiresnativeexecution
CPython versions tested on:
3.13
Operating systems tested on:
macOS