Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 links wasmtime_wasi::p2 and wasmtime_wasi_http::p2 only; the p3 features are off.
  • Rust guests are built with plain cargo for wasm32-wasip2, using the wasip2 crate. cargo-component is not required. The target is listed in rust-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:actor world 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-sdk crate (M1) will use wit-bindgen directly for the wasmkeep:actor world.
  • A later move to 0.3 is a breaking change for guests and needs its own ADR and migration note.