Skip to content

Commit d43573e

Browse files
committed
Record Android cross-compile results and Skip stack blockers
1 parent 26f4f23 commit d43573e

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

Documentation/WasmPluginPlan.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,47 @@ battery/perf profiling on low-end Android.
420420

421421
Total ≈ 8–11 weeks. M1 and M2 are each independently shippable.
422422

423+
## 9.1 Android build status (verified 2026-07-19)
424+
425+
**What works.** The plugin engine cross-compiles for Android:
426+
427+
```sh
428+
swift build --swift-sdk swift-6.3.3-RELEASE_android --target BluetoothExplorerPluginEngine
429+
```
430+
431+
This clears the largest unknown in the original plan: WasmKit and its `_CWasmKit` C target build
432+
under the Swift Android SDK. One genuine portability bug surfaced and was fixed —
433+
`Bundle.urls(forResourcesWithExtension:subdirectory:)` returns `[NSURL]` (with an optional
434+
`lastPathComponent`) on Android's Foundation but `[URL]` on Darwin, so `PluginLoader` now normalizes
435+
the element type.
436+
437+
**What is blocked, for reasons unrelated to this feature.** The app-level Android build cannot
438+
currently be completed in this repo:
439+
440+
1. **A clean checkout does not resolve.** `swift-android-native` is required at two different
441+
branches (`feature/pureswift` and `main`) by different packages in the graph. Reproduced on
442+
unmodified `master` in a scratch worktree. `Package.resolved` is gitignored, so every fresh
443+
resolve hits this.
444+
2. **`skip-android-bridge` does not compile.** Its `AndroidBundle.swift` references a `BundleAccess`
445+
type that is defined nowhere in the resolved dependency set — the `feature/pureswift` fork
446+
expects a different `skip-foundation` revision than the one resolved. This stops
447+
`BluetoothExplorerModel` from cross-compiling for Android.
448+
3. **The gradle/skipstone path fails in its iOS prebuild** with 15 platform-requirement errors
449+
between dependencies (`AndroidBluetooth` and `AndroidLooper` leave iOS unspecified, so it defaults
450+
to iOS 12, while `Bluetooth`/`BluetoothGAP`/`GATT`/`Socket` require iOS 13; `SwiftJavaToolLib`
451+
hits the same against swift-syntax). Verified pre-existing: swapping in `master`'s `Package.swift`
452+
with the same pins produces the identical 15 errors.
453+
454+
Consequently **`.copy` delivery of `.wasm` resources into the APK remains unverified** — it needs a
455+
working app-level Android build. The base64-embed fallback is still the documented escape hatch.
456+
Fixing (1)–(3) is fork-alignment work on the Skip dependencies, not on the plugin system.
457+
423458
## 9. Top risks
424459

425460
| Risk | Mitigation |
426461
|---|---|
427-
| WasmKit unverified under this exact Skip Fuse fork stack (feature/pureswift branches, NDK 27, minSdk 28 vs API-30 floor) | M0 hard gate; WAMR fallback documented |
462+
| ~~WasmKit unverified on Android~~**resolved**: `swift build --swift-sdk swift-6.3.3-RELEASE_android --target BluetoothExplorerPluginEngine` succeeds, so WasmKit and `_CWasmKit` do cross-compile. One real portability bug was found and fixed (Android Foundation returns `[NSURL]` from `Bundle.urls(forResourcesWithExtension:)`). ||
463+
| App-level Android build blocked by pre-existing Skip fork breakage (see §9.1), so `.copy` of `.wasm` into the APK is still unverified | Fix fork alignment first; base64-embed fallback remains available |
428464
| swift-system version conflict in the dependency graph | M0 `swift package resolve` dry run; pin branch deps to revisions first |
429465
| No fuel/interruption in WasmKit — runaway plugin = abandoned spinning thread | dedicated thread per plugin, quarantine on first timeout, memory caps, CPU budget + kill switch; WAMR if containment becomes hard requirement |
430466
| App Store review of user-imported plugins (2.5.2 / 3.3.1(B)) | bundled-first rollout; import framed as same-purpose interpreted content; no marketplace ever |

0 commit comments

Comments
 (0)