fix(ios): keep KeepAwakeBridge core JavaScriptCore-free (unblocks full-Bun device build) - #12016
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ine build) #11897 split the JSContext `keep_awake_set` installer into `KeepAwakeBridge+JSContext.swift` so the core `KeepAwakeBridge` type stays JavaScriptCore-free and compiles into the full-Bun engine build (whose podspec omits JavaScriptCore + JSContextHelpers). But the base `KeepAwakeBridge.swift` still carried a leftover `install(into ctx: JSContext)` (+ `import JavaScriptCore`) calling `ctx.installBridgeFunction` — which is defined in `JSContextHelpers.swift`, NOT in the full-Bun source set. Result: the device build (ELIZA_IOS_FULL_BUN_ENGINE=1) failed with `value of type 'JSContext' has no member 'installBridgeFunction'` (and the compat build would hit a redeclaration vs the +JSContext extension). Remove the duplicate installer + import from the core file. The JSContext install lives solely in `KeepAwakeBridge+JSContext.swift` (compat build); the full-Bun path drives the same holder via `setEnabled` from FullBunEngineHost. Unblocks `ios:device:deploy`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Restore unrelated generated/assets/training files that landed in #12016 while keeping the intended KeepAwakeBridge Swift fix.\n\nValidation:\n- git diff --check\n- xcrun --sdk iphonesimulator swiftc -typecheck -target arm64-apple-ios15.0-simulator plugins/plugin-native-bun-runtime/ios/Sources/ElizaBunRuntimePlugin/bridge/KeepAwakeBridge.swift\n- xcrun --sdk iphonesimulator swiftc -typecheck -target arm64-apple-ios15.0-simulator plugins/plugin-native-bun-runtime/ios/Sources/ElizaBunRuntimePlugin/JSContextHelpers.swift plugins/plugin-native-bun-runtime/ios/Sources/ElizaBunRuntimePlugin/bridge/KeepAwakeBridge.swift plugins/plugin-native-bun-runtime/ios/Sources/ElizaBunRuntimePlugin/bridge/KeepAwakeBridge+JSContext.swift\n- Restored files match pre-#12016 tree c9803c4
LifeOps Benchmark —
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
The iOS device build (
ELIZA_IOS_FULL_BUN_ENGINE=1) fails to compile:#11897 split the JSContext
keep_awake_setinstaller intoKeepAwakeBridge+JSContext.swiftspecifically so the coreKeepAwakeBridgetype stays JavaScriptCore-free and compiles into the full-Bun engine build — whose podspec (ElizaosCapacitorBunRuntime.podspec,include_full_bun_enginebranch) omitsJavaScriptCoreand lists only a minimal source set (noJSContextHelpers.swift, no+JSContext.swift). But the baseKeepAwakeBridge.swiftstill carried a leftoverinstall(into ctx: JSContext)(+import JavaScriptCore) that callsctx.installBridgeFunction— the extension defined in the excludedJSContextHelpers.swift. So the full-Bun build can't resolve it (and the compat build would hit a redeclaration vs the+JSContextextension).Removed the duplicate installer + import from the core file. The JSContext install now lives solely in
KeepAwakeBridge+JSContext.swift(compat build); the full-Bun path drives the same ref-counted holder viasetEnabledfromFullBunEngineHost.Verified by re-running
ios:device:deployto a physical iPhone (build proceeds past the Swift compile). Native/on-device evidence attached once the device install completes.🤖 Generated with Claude Code