feat(watchos): target arm64 (aarch64-apple-watchos) for device builds#5034
Merged
Conversation
arm64_32 cannot host Perry's NaN-boxed values (48-bit pointer tags need 64-bit usize), so real-watch builds never linked. watchOS 26 moved S9+ watches to full arm64, making the device target viable: swap the device triple to aarch64-apple-watchos, Swift/linker triples to arm64-apple-watchos26.0, and raise the watch bundle MinimumOSVersion accordingly (simulator keeps 10.0). Note: App Store submissions additionally require MinimumOSVersion >= 27.0 for arm64-only watch apps (arm64_32 slice mandatory below that).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Real-watch builds (
--target watchos) have never linked: the device triple wasarm64_32-apple-watchos, and Perry's NaN-boxed value representation (48-bit pointer masks, tags in the high 16 bits of a 64-bit word) fundamentally requires 64-bitusize—perry-runtimedoesn't even compile for arm64_32 ("literal out of range for usize" in value.rs).watchOS 26 moved S9-and-later watches to full arm64, so a 64-bit device target now exists. Apple also requires arm64 for all new watchOS App Store submissions since July 2025.
What
arm64_32-apple-watchos→aarch64-apple-watchos(codegen helpers + native-lib target mapping)arm64_32-apple-watchos10.0→arm64-apple-watchos26.0(link, platform_cmd, watchos-widget)MinimumOSVersion: 26.0 for device builds (simulator keeps 10.0)-Z build-stdinvocation the tier-3 target needsValidation
Built a real game (Bloom Jump) end to end:
perry-runtime+perry-ui-watchosvia nightly build-std foraarch64-apple-watchos, game compiled/linked with--features watchos-swift-app, produced a Mach-Oplatform WATCHOS minos 26.0arm64 executable, signed and accepted by App Store Connect (uploaded as a watch-only app, processing).Notes
aarch64-apple-watchosis a tier-3 Rust target: runtime libs needcargo +nightly build -Z build-std=std,panic_abort. Worth wiring into release-packages.yml so PERRY_RUNTIME_DIR users get prebuilt .a files.MinimumOSVersion >= 27.0for arm64-only watch apps (below that an arm64_32 slice is mandatory). 26.0 is kept here because it allows Xcode dev-installs on S9+ watches running watchOS 26; store packaging can re-stamp withvtool -set-build-version watchos 27.0. Could alternatively make this a perry.toml knob — happy to follow up.perry publish watchossupport could build on this).