Skip to content

fix(ios): #1311 make --enable-geisterhand build + link for --target ios#1316

Merged
proggeramlug merged 1 commit into
mainfrom
worktree-fix-1311-geisterhand-ios
May 22, 2026
Merged

fix(ios): #1311 make --enable-geisterhand build + link for --target ios#1316
proggeramlug merged 1 commit into
mainfrom
worktree-fix-1311-geisterhand-ios

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Closes #1311.

Geisterhand was unusable on iOS — both compile and link failed — while macOS worked. Root cause: perry-ui-macos has no perry-runtime Cargo dependency and reaches the runtime only through #[no_mangle] C-ABI symbols, so it's immune to feature-set hash drift. perry-ui-ios does depend on perry-runtime and was reaching into it via Rust paths.

Failure 1 — compile errors (E0425)

perry-ui-ios's ffi submodule functions weren't re-exported at crate root, so geisterhand_style.rs + app.rs's crate::perry_ui_* paths didn't resolve. Added pub use ffi::<sub>::*; re-exports — the same pattern perry-ui-macos uses via lib_ffi.

Failure 2 — link symbol-hash mismatch

iOS called two plain Rust runtime functions by path — app_group::configured_suite_name and stub_diag::perry_stub_warn — whose hash-mangled symbols differed between the --features geisterhand UI lib and the auto-optimized runtime it links against → "Undefined symbols". Routed both through stable #[no_mangle] C-ABI: reused the existing perry_app_group_suite_name, added a new perry_stub_warn_ffi shim. Verified at the symbol level that perry-ui-ios's own objects now have zero hash-mangled perry_runtime references.

Cold-build ordering bug (issue Ask #2)

runtime_lib was resolved via find_geisterhand_runtime before the link step auto-builds the geisterhand libs, so a cold build fell back to the host runtime → building for 'iOS-simulator', but linking object built for 'macOS'. Now the geisterhand libs are built before runtime resolution (idempotent missing-check).

CI smoke (issue Ask #3)

Added a geisterhand iOS compile-smoke to simctl-tests.yml (tag-push only): device-target libs + a full perry compile --target ios-simulator --enable-geisterhand on the geisterhand demo.

Validation

  • Compiles for aarch64-apple-ios and aarch64-apple-ios-sim, with and without geisterhand.
  • Cold perry compile --target ios-simulator --enable-geisterhand → valid arm64 iOS-sim .app bundle with all perry_geisterhand_* symbols linked.
  • No regression: host macOS geisterhand compile works; cargo fmt --all --check clean; stub_diag tests pass.

Per contributor convention this PR does not bump the version or touch CHANGELOG.md.

Geisterhand was unusable on iOS (both compile and link failed) while macOS
worked. Root cause: perry-ui-macos has no perry-runtime Cargo dep and reaches
the runtime only through #[no_mangle] C-ABI symbols, so it's immune to
feature-set hash drift; perry-ui-ios depends on perry-runtime and reached into
it via Rust paths.

- perry-ui-ios/src/lib.rs: re-export the ffi submodule fns at crate root so
  geisterhand_style.rs + app.rs `crate::perry_ui_*` paths resolve (was E0425
  "cannot find ... in the crate root"). Mirrors perry-ui-macos's lib_ffi
  re-exports.

- perry-ui-ios/src/ffi/system.rs: route the two plain-Rust runtime calls
  (app_group::configured_suite_name, stub_diag::perry_stub_warn) through stable
  #[no_mangle] C-ABI symbols. Their hash-mangled names differed between the
  --features geisterhand UI lib and the auto-optimized runtime it links
  against, causing "Undefined symbols". Reuses the existing
  perry_app_group_suite_name and the new perry_stub_warn_ffi shim.

- perry-runtime/src/stub_diag.rs: add perry_stub_warn_ffi C-ABI shim.

- perry/src/commands/compile.rs: build the geisterhand libs before resolving
  runtime_lib. On a cold build they didn't exist yet, so resolution fell back
  to find_runtime_library() = host runtime, and the iOS link failed with
  "building for 'iOS-simulator', but linking object built for 'macOS'".

- simctl-tests.yml: add a geisterhand iOS compile-smoke (device-target libs +
  full `perry compile --target ios-simulator --enable-geisterhand`).
@proggeramlug proggeramlug merged commit f11af60 into main May 22, 2026
16 of 17 checks passed
@proggeramlug proggeramlug deleted the worktree-fix-1311-geisterhand-ios branch May 22, 2026 09:32
proggeramlug added a commit that referenced this pull request May 22, 2026
…sweep (#1414)

Rolls up 26 PRs that merged to main post-v0.5.1023 without version
bumps:

- node:crypto gap-fixes (#1386 #1393 #1394 #1402 #1405): randomInt,
  timingSafeEqual, getHashes/getCiphers, sha224/sha384, base64 digest,
  Buffer hash input, no-arg digest() → Buffer, pbkdf2Sync digest arg,
  scryptSync.
- node:perf_hooks (#1321 + #1328 #1342 coverage): performance + User
  Timing + PerformanceObserver native impl, granular node-suite +
  edge-case coverage.
- #1090 GC checkpoint runtime work (#1324).
- #1311 geisterhand on iOS (#1316 #1383 #1384 #1385).
- #1312 process.env.X (unset) is nullish undefined (#1314).
- #1319 thread-safety hardening for cross-thread runtime statics.
- #1322 exact-head GC evidence packet.
- #1323 wasm timers dispatch through mem_call bridge (#1329).
- #1317 node:timers/promises shadow-segfault fix (#1326).
- #1330 node:process suite (#1331).
- #1292 bcrypt.hash() returns String (#1307).
- #1293 fastify .json()/.body external-fastify dispatch (#1308).
- #1296 app pattern performance gaps.
- #1297 diagnostics_channel parity.
- #1301 iOS App Groups capability (#1313).
- #1318 #1325 os/methods/modern-methods static dispatch.
- #1315 expanded Node parity test coverage.
- #1382 ui-ios stdlib pump for async fetch.
- #1392 ui-wasm reactive state + setText (#1404).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--enable-geisterhand fails to build for --target ios (compile + link errors in iOS geisterhand glue)

1 participant