From 6bba56c179f6cae51d5182ba45219118b3a82c4f Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Wed, 4 Nov 2026 13:58:59 -0500 Subject: [PATCH 1/2] Depend on the WasmKit fork with wasmkit_tc_start defined in C, so calls into plugins don't crash --- Package.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 8ec7d73..44ddfc8 100644 --- a/Package.swift +++ b/Package.swift @@ -26,15 +26,20 @@ let package = Package( // SwiftUI for Android. Apple platforms use the system SwiftUI instead, so this is only // linked for .android — see the conditional target dependencies below. .package(url: "https://github.com/PureSwift/AndroidSwiftUI.git", branch: "master"), - // Fork of WasmKit 0.3.1 with one change: upstream declares - // `.treatAllWarnings(as: .error)` for Apple platforms, which collides with the - // `-suppress-warnings` Xcode passes to package dependencies and makes the app fail to build - // in Xcode ("Conflicting options '-warnings-as-errors' and '-suppress-warnings'"). That - // setting only reaches package targets from the command line, so it cannot be overridden - // from the xcconfig or the project. Track upstream and drop the fork once it is fixed there. + // Fork of WasmKit 0.3.1 with two changes: + // - Upstream declares `.treatAllWarnings(as: .error)` for Apple platforms, which collides + // with the `-suppress-warnings` Xcode passes to package dependencies and makes the app + // fail to build in Xcode ("Conflicting options '-warnings-as-errors' and + // '-suppress-warnings'"). That setting only reaches package targets from the command + // line, so it cannot be overridden from the xcconfig or the project. + // - `wasmkit_tc_start` is defined in C rather than inline. Inlined into Swift, the call to + // the first direct-threaded handler assumed the handlers keep x22, which they do not, and + // every call into a plugin crashed in optimized builds when memory bounds are checked in + // software, as they are on iOS. + // Track upstream and drop the fork once both are fixed there. .package( url: "https://github.com/MillerTechnologyPeru/WasmKit.git", - revision: "ba06b7c64b5bc692c19c301ba2ef843c8d0f37c2" + revision: "80990b79f7d8aaf222cf806afa6252733acfa603" ) ], targets: [ From f4719a1a7960dac92ad651b2b98606d3453b5314 Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Wed, 4 Nov 2026 13:58:59 -0500 Subject: [PATCH 2/2] Resolve WasmKit at 80990b7 --- Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.resolved b/Package.resolved index 51a2888..601f059 100644 --- a/Package.resolved +++ b/Package.resolved @@ -168,7 +168,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/MillerTechnologyPeru/WasmKit.git", "state" : { - "revision" : "ba06b7c64b5bc692c19c301ba2ef843c8d0f37c2" + "revision" : "80990b79f7d8aaf222cf806afa6252733acfa603" } } ],