Skip to content

fix(perry/ios): perry-ui-ios fails to compile — stale perry_runtime::thread::pin_promise reference #9961

Description

@steinybot

perry-ui-ios fails to compile for an iOS target. foundation_models.rs:108 calls perry_runtime::thread::pin_promise, which no longer exists — it is the only reference to that symbol left in the tree, and it was orphaned when the pinning API moved (last touched by #8700 in August).

error[E0425]: cannot find function `pin_promise` in module `perry_runtime::thread`
   --> crates/perry-ui-ios/src/foundation_models.rs:108:37
error: could not compile `perry-ui-ios` (lib) due to 1 previous error

Why it went unnoticed: the crate is #![cfg(target_os = "ios")], so on a macOS host cargo build -p perry-ui-ios compiles it to nothing and the reference is never checked. It only surfaces on an actual iOS target build (--target aarch64-apple-ios-sim).

Fix: pin the cross-thread promise through the current API. The primitive is perry_runtime::gc::pin_object on the promise's GC header; perry_stdlib::common::async_bridge::pin_promise_for_native_resolution(promise_ptr: usize) already wraps exactly this. Route foundation_models.rs to the same mechanism.

CI gap to reconcile: iOS workflows exist (test.yml, simctl-tests.yml). If none of them compiles perry-ui-ios for an iOS target, that is the gate gap that let this land — a compile of this crate for aarch64-apple-ios[-sim] would have caught it. Worth a required build step.

Found while implementing #9954 (TextField padding), which needed an iOS-sim compile to verify.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions