Bug
In `crates/perry/src/commands/compile.rs` at the `find_native_library` match (around line 1504), watchOS targets fall through to the `_ => "macos"` default:
```rust
let target_key = match target {
Some("ios-simulator") | Some("ios") => "ios",
Some("android") => "android",
Some("tvos-simulator") | Some("tvos") => "tvos",
Some("linux") => "linux",
Some("windows") => "windows",
Some("web") => "web",
None if cfg!(target_os = "linux") => "linux",
None if cfg!(target_os = "windows") => "windows",
_ => "macos",
};
```
So when `--target watchos-simulator` is used with a `perry.nativeLibrary` package, Perry picks up the `macos` entry (`native/macos/`) and tries to build it for the watch-sim target — which fails with unrelated errors like `rfd` not implementing `FileSaveDialogImpl`.
Repro
With the current bloom-jump + bloom-engine tree:
```
cd /path/to/jump
perry compile --target watchos-simulator --features watchos-game-loop src/main.ts -o BloomJumpWatch
```
Fails with `error: could not compile `rfd` ... Failed to build native library crate for bloom/core: native/macos/` — wrong crate.
Fix
Add the watchos arm to the match:
```rust
Some("watchos-simulator") | Some("watchos") => "watchos",
```
Follow-up on the bloom side (not Perry's concern)
Once this lands, bloom's `package.json` needs a `perry.nativeLibrary.targets.watchos` entry pointing at a new `native/watchos/` crate. That's tracked separately — this issue is only about Perry picking the correct key.
Related
Bug
In `crates/perry/src/commands/compile.rs` at the `find_native_library` match (around line 1504), watchOS targets fall through to the `_ => "macos"` default:
```rust
let target_key = match target {
Some("ios-simulator") | Some("ios") => "ios",
Some("android") => "android",
Some("tvos-simulator") | Some("tvos") => "tvos",
Some("linux") => "linux",
Some("windows") => "windows",
Some("web") => "web",
None if cfg!(target_os = "linux") => "linux",
None if cfg!(target_os = "windows") => "windows",
_ => "macos",
};
```
So when `--target watchos-simulator` is used with a `perry.nativeLibrary` package, Perry picks up the `macos` entry (`native/macos/`) and tries to build it for the watch-sim target — which fails with unrelated errors like `rfd` not implementing `FileSaveDialogImpl`.
Repro
With the current bloom-jump + bloom-engine tree:
```
cd /path/to/jump
perry compile --target watchos-simulator --features watchos-game-loop src/main.ts -o BloomJumpWatch
```
Fails with `error: could not compile `rfd` ... Failed to build native library crate for bloom/core: native/macos/` — wrong crate.
Fix
Add the watchos arm to the match:
```rust
Some("watchos-simulator") | Some("watchos") => "watchos",
```
Follow-up on the bloom side (not Perry's concern)
Once this lands, bloom's `package.json` needs a `perry.nativeLibrary.targets.watchos` entry pointing at a new `native/watchos/` crate. That's tracked separately — this issue is only about Perry picking the correct key.
Related