Skip to content

Commit 4486786

Browse files
committed
Add WASIp3 support
This adds wasi:{cli,clocks,filesystem,http,random,sockets}@0.3.0-rc-2025-08-15 support, including inbound and outbound HTTP requests. I've smoke tested this manually with a few WASIp3 components and plan to port over some or all of the existing WASIp2 tests. TODO: - Port wasi:[email protected] tests - Add `Instrument::in_current_span` calls where necessary (e.g. in wasip3.rs) - Update to next release candidate once the `release-37.0.0` branch supports it - Switch to the final 37.0.0 release once it's available Signed-off-by: Joel Dice <[email protected]>
1 parent fe6f479 commit 4486786

File tree

15 files changed

+724
-251
lines changed

15 files changed

+724
-251
lines changed

Cargo.lock

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ futures-util = "0.3"
136136
glob = "0.3"
137137
heck = "0.5"
138138
http = "1"
139+
http-body = "1"
139140
http-body-util = "0.1"
140141
hyper = { version = "1", features = ["full"] }
141142
hyper-util = { version = "0.1", features = ["tokio"] }
142143
indexmap = "2"
143144
itertools = "0.14"
144145
lazy_static = "1.5"
145146
path-absolutize = "3"
147+
pin-project-lite = "0.2.16"
146148
quote = "1"
147149
rand = "0.9"
148150
redis = "0.32.5"
@@ -175,9 +177,9 @@ wasm-metadata = "0.239.0"
175177
wasm-pkg-client = "0.11"
176178
wasm-pkg-common = "0.11"
177179
wasmparser = "0.239.0"
178-
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" }
179-
wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" }
180-
wasmtime-wasi-http = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" }
180+
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0", features = ["component-model-async"] }
181+
wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0", features = ["p3"] }
182+
wasmtime-wasi-http = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0", features = ["p3"] }
181183
wit-component = "0.239.0"
182184
wit-parser = "0.239.0"
183185

crates/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl Default for Config {
7575
inner.async_support(true);
7676
inner.epoch_interruption(true);
7777
inner.wasm_component_model(true);
78+
inner.wasm_component_model_async(true);
7879
// If targeting musl, disable native unwind to address this issue:
7980
// https://github.com/spinframework/spin/issues/2889
8081
// TODO: remove this when wasmtime is updated to >= v27.0.0

crates/factor-outbound-http/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ edition = { workspace = true }
88
anyhow = { workspace = true }
99
bytes = { workspace = true }
1010
http = { workspace = true }
11+
http-body = { workspace = true }
1112
http-body-util = { workspace = true }
1213
hyper = { workspace = true }
1314
hyper-util = { workspace = true }
15+
pin-project-lite = { workspace = true }
1416
reqwest = { workspace = true, features = ["gzip"] }
1517
rustls = { workspace = true }
1618
serde = { workspace = true }

crates/factor-outbound-http/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub use wasmtime_wasi_http::{
3131
HttpResult,
3232
};
3333

34+
pub use wasi::{p2_to_p3_error_code, p3_to_p2_error_code};
35+
3436
#[derive(Default)]
3537
pub struct OutboundHttpFactor {
3638
_priv: (),

0 commit comments

Comments
 (0)