◐ Shell
clean mode source ↗

Declare native execution in macOS .app bundle Info.plist by KiloNiner · Pull Request #27591 · PowerShell/PowerShell

Add LSRequiresNativeExecution to the macOS launcher app Info.plist so
Apple Silicon Launch Services does not offer Rosetta when opening
/Applications/PowerShell.app. The shipped pwsh binary is arm64-native
in the osx-arm64 package; the Rosetta prompt is purely a bundle-metadata
artifact (script-based CFBundleExecutable, unsigned bundle, no arch
hint in the plist).

The key is a no-op on Intel Macs (no Rosetta translates Intel binaries
on Intel hardware), so it is safe to add unconditionally to the shared
template used for both osx-arm64.pkg and osx-x64.pkg builds.

Fixes PowerShell#18548

AI review requested due to automatic review settings

June 10, 2026 18:14

This was referenced

Jun 10, 2026
Address review feedback: only emit the LSRequiresNativeExecution key in
the launcher Info.plist for osx-arm64 builds, not for osx-x64.

The previous version added the key unconditionally to the shared
template. That is safe on Intel Macs (the key is a no-op on hardware
where Rosetta does not translate Intel binaries) and on Apple Silicon
running the arm64 build (the goal), but it would prevent the .app
launcher from working under Rosetta if an Apple Silicon user installs
the osx-x64 package -- an unsupported but previously-working
configuration.

Make the substitution conditional via a new HostArchitecture parameter
on New-MacOSLauncher, threaded through from New-UnixPackage where
HostArchitecture is already in scope ("arm64" or "x86_64" for osxpkg
builds). The plist template gains a {3} placeholder that receives
either the LSRequiresNativeExecution block (arm64) or empty (x86_64).

SamErde

Explain that the root cause requiring the key is Launch Services being
unable to infer CPU architecture from a shell script launcher, causing it
to default to offering Rosetta translation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>