feat(runtime): Add support for wasm32-wasip2 compilation target#4058
feat(runtime): Add support for wasm32-wasip2 compilation target#4058Aditya1404Sal wants to merge 2 commits intolaunchbadge:mainfrom
wasm32-wasip2 compilation target#4058Conversation
|
You're welcome to continue experimenting with this, but there's no point in merging this until it's stabilized as a target for |
Totally fair, I understand it’s still experimental. The WASI Preview 3 target (wasm32-wasip3) is expected to land in the next Rust release or just after that (most probably), but for now I’m using wasm32-wasip2 as the dev target to keep things working. It’s mostly exploratory right now, but it does feel like something that’ll be quite useful once stabilized. |
|
@abonander Would it be alright to keep this PR open as a reference while I continue experimenting, or would you prefer I link to my fork in the relevant issue and close this PR to keep the list clean? |
e25f19f to
a71af8a
Compare
wasm32-wasip3 compilation target.]wasm32-wasip2 compilation target
b58b31e to
af5a030
Compare
- Add rt_wasip3 runtime module with TCP connect, spawn, sleep via wasip3 crate - Add wasm32-wasip2 target support in sqlx-core: fs, net/socket, net/tls, rt - Gate all non-wasm FS/network code with cfg(not(target_arch = "wasm32")) - Add wasm::fs module delegating to WASI filesystem primitives - Add wasi-tls WIT interface and tls_wasi.rs for WASM-native TLS - Add four MySQL WASM component test crates (connect, execute-query, pool-crud, prepared-query) - Add wasi_integration_test.rs for running WASM components against a live MySQL instance - Fix Cargo.toml deps: remove net/fs from workspace tokio (breaks wasm32), add wasm32 target-specific deps - Fix migrate source/migration: gate checksum_fragments and blocking resolve fns from wasm32 - Fix net/socket: clean wasm32 vs native branch split in connect_tcp, remove dead todo in connect_uds - Fix all wasm32 build warnings across migrate, net, rt modules Signed-off-by: Aditya <[email protected]>
af5a030 to
4f18e24
Compare
Signed-off-by: Aditya <[email protected]>
57f6b7c to
3cf56d2
Compare
Does your PR solve an issue?
closes #4056
Is this a breaking change?
No, New runtime would run separately, conditional compilation ensures that.
Limitations
This PR adds wasm32 target support for non-TLS backends only (for now since wasi-tls is in phase 1). Some stubs are intentionally left open for further development such as
sqlx-core/src/wasm/fs.rsto support future wasi-native file system certificate actions.