Skip to content

feat(runtime): Add support for wasm32-wasip2 compilation target#4058

Open
Aditya1404Sal wants to merge 2 commits intolaunchbadge:mainfrom
Aditya1404Sal:latest/wasip3
Open

feat(runtime): Add support for wasm32-wasip2 compilation target#4058
Aditya1404Sal wants to merge 2 commits intolaunchbadge:mainfrom
Aditya1404Sal:latest/wasip3

Conversation

@Aditya1404Sal
Copy link
Copy Markdown

@Aditya1404Sal Aditya1404Sal commented Oct 15, 2025

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.rs to support future wasi-native file system certificate actions.

@abonander
Copy link
Copy Markdown
Collaborator

You're welcome to continue experimenting with this, but there's no point in merging this until it's stabilized as a target for rustc itself. We don't have the bandwidth to maintain support for an experimental target.

@Aditya1404Sal
Copy link
Copy Markdown
Author

You're welcome to continue experimenting with this, but there's no point in merging this until it's stabilized as a target for rustc itself. We don't have the bandwidth to maintain support for an experimental target.

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.

@Aditya1404Sal
Copy link
Copy Markdown
Author

@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?

@Aditya1404Sal Aditya1404Sal force-pushed the latest/wasip3 branch 2 times, most recently from e25f19f to a71af8a Compare October 22, 2025 08:29
@Aditya1404Sal Aditya1404Sal changed the title WIP[feat(runtime): Add support for wasm32-wasip3 compilation target.] feat(runtime): Add support for wasm32-wasip2 compilation target Oct 27, 2025
@Aditya1404Sal Aditya1404Sal marked this pull request as ready for review October 27, 2025 06:49
@Aditya1404Sal Aditya1404Sal marked this pull request as draft October 27, 2025 06:49
@Aditya1404Sal Aditya1404Sal marked this pull request as ready for review November 2, 2025 18:09
- 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 <aditya.salunkh919@gmail.com>
Signed-off-by: Aditya <aditya.salunkh919@gmail.com>
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.

[Discussion] Add wasm32-wasip2 compilation target support to runtime dispatcher & wasi-socket support

2 participants