0001. Target WASI 0.2 and build Rust guests with plain cargo
- Status: accepted
- Date: 2026-11-02
- Milestone: M0
Context
Which WASI version to target was an open question at the start: wasi:http
0.2 is stable, 0.3 brings native async. Wasmtime 50 (pinned for M0) ships host
implementations of both (wasmtime-wasi-http features p2 and p3).
The initial design named cargo-component as the Rust guest toolchain. Since
Rust gained the tier-2 wasm32-wasip2 target, a plain cargo build --target wasm32-wasip2 of a cdylib already emits a component, and the official
wasip2 crate provides the wasi:http/proxy bindings and export! macro.
Decision
- Guests target WASI 0.2 (
wasi:http/proxy@0.2). The host linkswasmtime_wasi::p2andwasmtime_wasi_http::p2only; thep3features are off. - Rust guests are built with plain cargo for
wasm32-wasip2, using thewasip2crate.cargo-componentis not required. The target is listed inrust-toolchain.toml, so rustup installs it automatically. - WASI 0.3 is revisited when the guest toolchains (wit-bindgen async, TinyGo,
componentize-py, ComponentizeJS) treat it as stable, and at the latest when
M1’s
wasmkeep:actorworld needs async exports. Because tenants program against WasmKeep’s own WIT world, the migration is confined to the host bindings and the SDK.
Consequences
- Every guest toolchain WasmKeep plans to support (Rust, TinyGo, componentize-py, ComponentizeJS) can produce 0.2 components today; 0.3 would exclude some of them.
- Request handling uses the synchronous-export, async-host model: one event at a time per instance, which is also the actor model’s contract.
- One fewer tool to install for contributors and in CI. The
wasmkeep-sdkcrate (M1) will usewit-bindgendirectly for thewasmkeep:actorworld. - A later move to 0.3 is a breaking change for guests and needs its own ADR and migration note.