Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/perry-codegen/src/codegen/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub(crate) fn default_target_triple() -> String {
/// Supported:
/// * `ios`, `ios-simulator` → aarch64-apple-ios
/// * `visionos`, `visionos-simulator` → arm64-apple-xros1.0{,-simulator}
/// * `watchos` → arm64_32-apple-watchos (ILP32)
/// * `watchos` → aarch64-apple-watchos (arm64, S9+ / watchOS 26)
/// * `watchos-simulator` → arm64-apple-watchos10.0-simulator
/// * `tvos`, `tvos-simulator` → aarch64-apple-tvos
/// * `android` → aarch64-unknown-linux-android
Expand All @@ -397,7 +397,7 @@ pub fn resolve_target_triple(name: &str) -> Option<String> {
"ios-simulator" => Some("arm64-apple-ios17.0-simulator".to_string()),
"visionos" => Some("arm64-apple-xros1.0".to_string()),
"visionos-simulator" => Some("arm64-apple-xros1.0-simulator".to_string()),
"watchos" => Some("arm64_32-apple-watchos".to_string()),
"watchos" => Some("aarch64-apple-watchos".to_string()),
"watchos-simulator" => Some("arm64-apple-watchos10.0-simulator".to_string()),
"tvos" => Some("aarch64-apple-tvos".to_string()),
"tvos-simulator" => Some("arm64-apple-tvos17.0-simulator".to_string()),
Expand Down
2 changes: 1 addition & 1 deletion crates/perry/src/commands/compile/app_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub(super) fn rust_target_triple(target: Option<&str>) -> Option<&'static str> {
Some("visionos-simulator") => Some("aarch64-apple-visionos-sim"),
Some("visionos") => Some("aarch64-apple-visionos"),
Some("watchos-simulator") => Some("aarch64-apple-watchos-sim"),
Some("watchos") => Some("arm64_32-apple-watchos"),
Some("watchos") => Some("aarch64-apple-watchos"),
Some("tvos-simulator") => Some("aarch64-apple-tvos-sim"),
Some("tvos") => Some("aarch64-apple-tvos"),
Some("harmonyos") => Some("aarch64-unknown-linux-ohos"),
Expand Down
10 changes: 9 additions & 1 deletion crates/perry/src/commands/compile/bundle_apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ pub(super) fn bundle_for_watchos(
// #4849: read version/build_number from perry.toml (was hardcoded "1.0").
let (app_version, app_build_number) = read_apple_app_version(input);

// Device builds are arm64-only, which requires watchOS 26 (S9+); the
// simulator target keeps the lower floor.
let min_os = if target == Some("watchos-simulator") {
"10.0"
} else {
"26.0"
};

let info_plist = format!(
r#"<?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">
Expand All @@ -189,7 +197,7 @@ pub(super) fn bundle_for_watchos(
<key>CFBundleShortVersionString</key>
<string>{app_version}</string>
<key>MinimumOSVersion</key>
<string>10.0</string>
<string>{min_os}</string>
<key>UIDeviceFamily</key>
<array>
<integer>4</integer>
Expand Down
6 changes: 4 additions & 2 deletions crates/perry/src/commands/compile/link/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ pub(super) fn build_and_run_link(
let (lib_name, build_cmd) = if is_watchos {
(
"libperry_ui_watchos.a",
"cargo build --release -p perry-ui-watchos --target arm64_32-apple-watchos",
"cargo +nightly build -Z build-std=std,panic_abort --release -p perry-ui-watchos --target aarch64-apple-watchos (or --target aarch64-apple-watchos-sim for the simulator)",
)
} else if is_tvos {
(
Expand Down Expand Up @@ -1755,7 +1755,9 @@ pub(super) fn build_and_run_link(
let swift_triple = if target == Some("watchos-simulator") {
"arm64-apple-watchos10.0-simulator"
} else {
"arm64_32-apple-watchos10.0"
// Device builds are arm64-only (S9+ / watchOS 26): Perry's
// NaN-boxed values need 64-bit pointers, which arm64_32 lacks.
"arm64-apple-watchos26.0"
};
let swift_sysroot = String::from_utf8(
Command::new("xcrun")
Expand Down
4 changes: 3 additions & 1 deletion crates/perry/src/commands/compile/link/platform_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ pub fn select_linker_command(
let triple = if target == Some("watchos-simulator") {
"arm64-apple-watchos10.0-simulator"
} else {
"arm64_32-apple-watchos10.0"
// Device builds are arm64-only (S9+ / watchOS 26): Perry's
// NaN-boxed values need 64-bit pointers, which arm64_32 lacks.
"arm64-apple-watchos26.0"
};

// Find the entry object whose stem matches the user's input file stem
Expand Down
4 changes: 3 additions & 1 deletion crates/perry/src/commands/compile/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,9 @@ pub(super) fn compile_for_watchos_widget(
let target_triple = if is_simulator {
"arm64-apple-watchos10.0-simulator"
} else {
"arm64_32-apple-watchos10.0"
// Device builds are arm64-only (S9+ / watchOS 26), matching the app
// target: Perry's NaN-boxed values need 64-bit pointers.
"arm64-apple-watchos26.0"
};
let mut frameworks = vec!["WidgetKit", "SwiftUI"];
if uses_app_intents {
Expand Down