Skip to content

feat: Enable WebAssembly compilation#3

Merged
krodak merged 1 commit into
mainfrom
feat/wasm-compilation
Jul 23, 2026
Merged

feat: Enable WebAssembly compilation#3
krodak merged 1 commit into
mainfrom
feat/wasm-compilation

Conversation

@krodak

@krodak krodak commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add WebAssembly (wasm32-unknown-wasip1) support to SQLiteKit. Uses upstream apple/swift-nio plus the standalone PassiveLogic/nio-async-runtime, and consumes the wasm-safe PassiveLogic sqlite-nio and async-kit forks. Imports NIOAsyncRuntime's NIOThreadPool on wasi and NIOPosix elsewhere. On Swift 6.3 SPM selects the Package@swift-5.9.swift variant, which carries the wasm wiring.

Draft: references PassiveLogic/sqlite-nio and PassiveLogic/async-kit by version, and those tags do not exist yet (their wasm PRs need to merge and tag first). CI cannot resolve dependencies until then. Ready to finalize once the sibling tags land.

Links

What changed

  • Package@swift-5.9.swift - depend on apple/swift-nio + PassiveLogic/nio-async-runtime; point sqlite-nio and async-kit at the PassiveLogic forks; gate NIOPosix to non-wasi and NIOAsyncRuntime to wasi.
  • Sources/SQLiteKit/SQLiteConnectionSource.swift - #if os(WASI) import NIOAsyncRuntime (drop-in NIOThreadPool), NIOPosix elsewhere.
  • .github/workflows/test.yml - enable the wasm job (with_wasm: true).

Tested

  • swift build (native + wasm, resolved against the sibling forks)

Add wasm (wasm32-unknown-wasip1) support in Package@swift-5.9.swift: depend on
upstream apple/swift-nio plus the standalone PassiveLogic/nio-async-runtime, and
consume the wasm-safe PassiveLogic sqlite-nio and async-kit forks (pinned to the
same version ranges as upstream, resolved once those forks are tagged). Import
NIOAsyncRuntime's NIOThreadPool on wasi and NIOPosix elsewhere, gated on
os(WASI). NIOPosix is gated to non-wasi; non-wasm builds are unchanged.

Co-authored-by: Scott Marchant <scottm@passivelogic.com>
@krodak
krodak force-pushed the feat/wasm-compilation branch from 5aff138 to abac88b Compare July 21, 2026 16:55
@krodak krodak self-assigned this Jul 22, 2026
@krodak
krodak marked this pull request as ready for review July 23, 2026 11:06
@krodak

krodak commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Merging — this completes the wasm fork chain (nio-async-runtime 1.0.1 → async-kit 1.22.0 → sqlite-nio 1.12.9 → sqlite-kit). Deps resolve against the tagged releases and CI is green (wasm + linux 6.1/6.2/6.3 + macOS). @scottmarchant flagging for visibility 🙏

@krodak
krodak merged commit 8374d3a into main Jul 23, 2026
29 checks passed
@krodak
krodak requested a review from scottmarchant July 23, 2026 11:34
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.

1 participant