You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/WasmPluginPlan.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -420,11 +420,47 @@ battery/perf profiling on low-end Android.
420
420
421
421
Total ≈ 8–11 weeks. M1 and M2 are each independently shippable.
422
422
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
+
423
458
## 9. Top risks
424
459
425
460
| Risk | Mitigation |
426
461
|---|---|
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 |
428
464
| swift-system version conflict in the dependency graph | M0 `swift package resolve` dry run; pin branch deps to revisions first |
429
465
| 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 |
430
466
| 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