Skip to content

Align spin-sdk with wasip3 0.9 and Wasmtime 50 - #1

Open
codeitlikemiley wants to merge 9 commits into
mainfrom
gol/wasi-dep-stabilization-1365
Open

codeitlikemiley wants to merge 9 commits into
mainfrom
gol/wasi-dep-stabilization-1365

Conversation

@codeitlikemiley

@codeitlikemiley codeitlikemiley commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Problem / repro

codeitlikemiley/spin-rust-sdk main (f0c4aeb) was six commits behind spinframework/spin-rust-sdk v7.0.0 (2dfd93d). On that older main, cargo tree / Cargo.lock resolved:

  • direct wasip3 0.7.0+wasi-0.3.0 (wit-bindgen 0.57.1)
  • a second wasip3 0.4.0+wasi-0.3.0-rc-2026-01-06 (wit-bindgen 0.51.0) through getrandom 0.4.2 on wasm32-wasip3
  • dev wasmtime / wasmtime-wasi / wasmtime-wasi-http 46.0.1

Upstream v7 moved the direct crate to wasip3 0.7.1 and declared wasmtime 47.0.2 (lock resolved 47.0.4) but still locked the wasip3 0.4 RC. spinframework/spin f1a5577 (2026-10-23) already builds the host on wasmtime 50.0.0 and wit-component 0.262.0. Nested test-case locks in both the fork and upstream v7 still resolved wasip3 0.6.0 (the March 2026 RC) and spin-sdk 6.0.0.

wasi-auth and ddd-cqrs-es pin git rev a02d330 (origin/codex/final-wasi-rust-1.93), which is not an ancestor of v7. leptos-spin templates, including upstream, still declare wasip3 0.6.0.

CI on the first push of this branch (Rust / Lint and Test, run 40094751148) compiled and passed the SDK tests, then failed cargo audit with two vulnerabilities: RUSTSEC-2026-0385 (ctutils 0.4.2) and RUSTSEC-2026-0381 (webpki-roots 1.0.9). The same run also warned on unsound tokio 1.52.3 (RUSTSEC-2026-0386) and yanked chacha20 0.10.0. Build Examples succeeded.

Root cause

The guest binding crate and the host runtime moved on different clocks. wasip3 0.7.1 / 0.8.0 / 0.9.0 all embed final package wasi:[email protected] (WIT files match between 0.7.1 and 0.9.0). The 0.4 and 0.6 crates are release-candidate snapshots and must not share a component with 0.9. getrandom 0.4.2 pulled the 0.4 RC as a target dependency; 0.4.3 replaced that with a manual wasi:random/[email protected] import. wasip3 0.8+ also renamed wit_bindgen::spawn to spawn_local.

Wasmtime 50 (MSRV 1.97, released 2026-10-20) moved WasiHttpView / default_hooks to the crate root and added a hooks argument to Request::from_http. The SDK tests were still written for the 46/47 layout.

The audit failure is separate from that bump. digest requires ctutils ^0.4, wasmtime-wasi-http 50 requires webpki-roots ^1.0.7, rand 0.10.1 requires chacha20 ^0.10.0, and spin-sdk requires tokio ^1.48. The lock had resolved older releases inside those ranges. Patched releases are already published, so no Cargo.toml requirement change is needed.

Upstream status

  • Fixed upstream in spin-sdk v7: wasip3 0.7.1, wasmtime 47.0.4, IntoRequest for types::Request, version 7.0.0. This branch fast-forwards those commits.
  • Not fixed upstream: wasip3 0.9.0 (wit-bindgen 0.62.0), wasmtime 50, wit-component 0.262, dropping wasip3 0.4, spawn to spawn_local, stale nested locks.
  • Fixed upstream in Spin, not in the July fork: wasmtime 50 / wit 0.262 / rust-version 1.96 at f1a5577. A1 should merge that, not re-bump wasmtime by hand.
  • Not fixed in spinframework/leptos-spin 480f1f7: templates still use wasip3 0.6.0. That upstream commit only pinned wasm-bindgen to 0.2.114.
  • The four audit crates are fixed on crates.io (ctutils >=0.4.4, webpki-roots >=1.0.10, tokio >=1.53.3, chacha20 0.10.2). They were not yet selected in this lock.

Implementation

No release. Package version stays 7.0.0.

  • wasip3 0.9.0 with http-compat and wit-bindgen-macros.
  • Dev-dependencies wasmtime, wasmtime-wasi, wasmtime-wasi-http 50.0.0 (p3), wit-component 0.262.
  • getrandom 0.4.3, which removes wasip3 0.4.0 from the lock. Guest wit-bindgen resolves to 0.62.0. wit-bindgen 0.51.0 remains only under wasip2 1.0.2 / getrandom 0.3.4. wit-component 0.259 and 0.261 remain because wit-bindgen 0.62 and wasmtime 50 pin them; 0.262 is the direct dev-dep.
  • rust-toolchain.toml and CI RUST_VERSION are 1.99.0 (rustc 1.99.0 (b940084d7 2026-09-28)). Library rust-version stays 1.94 because cargo +1.94.0 check -p spin-sdk succeeds. Wasmtime 50 is a dev-dependency and needs >=1.97 to compile tests.
  • SDK and examples call wasip3::spawn_local. Wasmtime 50 test host API updated.
  • Nested simple-http and simple-redis locks regenerated (single wasip3 0.9.0).
  • Lock-only advisory bumps, still inside the caret ranges above: ctutils 0.4.2 → 0.4.5, webpki-roots 1.0.9 → 1.0.11, tokio 1.52.3 → 1.54.1, chacha20 0.10.0 → 0.10.2. errno, rustix, tempfile, and winapi-util stay on windows-sys 0.61.2.
  • docs/stabilization/dependency-matrix.md has the cross-repo matrix and the exact Cargo.toml edits for spin, wasi-http-middleware, wasi-auth, leptos_wasi, leptos-spin, and ddd-cqrs-es.

Dependency commit: 3cf30012b50a1afb750dac3d28aa6da4a32c3468. Audit lock commit: f224ed1.

Tests / evidence

Toolchain: rustc 1.99.0 (b940084d7 2026-09-28), cargo 1.99.0 (5f94df478 2026-08-27). MSRV probe: rustc 1.94.0 (4a4ef493e 2026-03-02).

  • cargo +1.99.0 metadata --locked --format-version 1 resolved [email protected]+wasi-0.3.0, [email protected], [email protected], [email protected], and after the audit commit also [email protected], [email protected], [email protected], [email protected].
  • cargo +1.99.0 tree --locked --target all -i [email protected] shows only wasip2 1.0.2 → getrandom 0.3.4.
  • cargo +1.99.0 test -p spin-sdk --all-features --locked: 31 lib tests passed, including simple_http and simple_redis under Wasmtime 50. Doctests: 33 passed, 8 ignored. Re-run after the audit lock bumps with the same result.
  • cargo +1.99.0 audit (cargo-audit 0.22.2, 1352 advisories) exited 0 after those bumps. The previous lock failed that command on RUSTSEC-2026-0385 and RUSTSEC-2026-0381.
  • cargo +1.99.0 fmt --all -- --check
  • cargo +1.99.0 clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo +1.99.0 check --no-default-features, --features json, and --features postgres4-types
  • cargo +1.94.0 check -p spin-sdk --locked compiled the library and wasip3 0.9.0.
  • GitHub Actions on f224ed1: Rust run 40133774288 (Lint and Test, including audit dependencies) succeeded in 8m34s, and Build Examples run 40133774286 succeeded.

spin is not installed here, so spin build --up is unverified. Other repos were lockfile audits only; their recommended edits were not compiled.

Compatibility and security

wasip3 0.9.0 is the same wasi:[email protected] WIT as 0.7.1. The Rust break is spawn → spawn_local. Callers of spin_sdk::wasip3::spawn will not compile until they rename it. crates.io spin-sdk 7.0.0 does not include this bump.

Removing wasip3 0.4.0 drops a second, incompatible WIT snapshot from wasm32-wasip3 builds. getrandom 0.4.3 still imports wasi:random/[email protected].

The lock also moved transitive rustls 0.23.38 → 0.23.46 and http 1.4.0 → 1.5.0 because wasmtime 50's ranges allow them. The audit commit then moved ctutils, webpki-roots, tokio, and chacha20 to the patched releases named above. .cargo/audit.toml still ignores RUSTSEC-2026-0204 and RUSTSEC-2026-0258 from upstream v7; this PR does not claim those are resolved.

Library MSRV stays 1.94. CI is 1.99.0 because the test host needs Wasmtime 50.

Dependent PRs

Owned by other agents. Exact snippets are in docs/stabilization/dependency-matrix.md.

  • A1 codeitlikemiley/spin: merge upstream f1a5577 (already wasmtime 50). Then point examples/http-middleware/* git deps at 3cf30012b50a1afb750dac3d28aa6da4a32c3468 and rename wasip3::spawn in yelling. Leave historical spin-sdk 2.2.0 fixtures pinned.
  • A3 wasi-http-middleware: wasip3 = "=0.9.0", wit-bindgen = "=0.62.0", toolchain 1.99.0, spawn → spawn_local.
  • A4 wasi-auth: drop git rev a02d330; pin 3cf3001; same wasip3/wit-bindgen pins; declare server_fn 0.8.13; spin_grpc.rs uses spawn_local.
  • A5 leptos_wasi: wasip3 0.9.0, leptos 0.8.22, leptos_macro =0.8.19, server_fn 0.8.13. src/executor/p3.rs must call wasip3::spawn_local.
  • A6 leptos-spin: templates still on wasip3 0.6.0 RC on both the fork and upstream. Retarget to 0.9.0 / leptos 0.8.22 / this SDK rev. Upstream has not done this.
  • A7 ddd-cqrs-es: same SDK rev, wasip3 =0.9.0, replace leptos-wasi-runtime =0.4.2-rc.1 only after A5 publishes a 0.9-based 0.4.2. Published 0.4.2 is still the 0.7 guest.
Open in Web Open in Cursor 

Brian Hardock and others added 8 commits August 12, 2026 13:12
Signed-off-by: Brian Hardock <[email protected]>
Signed-off-by: Brian Hardock <[email protected]>
Upstream v7 still tested on Wasmtime 47 and locked a second wasip3 0.4 RC through getrandom 0.4.2, while spinframework/spin is on Wasmtime 50 and wasi:[email protected]. Pin CI to Rust 1.99.0, keep the library MSRV at 1.94, and record the cross-repo matrix.

Co-authored-by: Uriah Galang <[email protected]>
Other agents can pin spin-rust-sdk to 3cf3001 without waiting on a merge SHA.

Co-authored-by: Uriah Galang <[email protected]>
Bump ctutils to 0.4.5, webpki-roots to 1.0.11, tokio to 1.54.1, and chacha20 to 0.10.2 inside existing caret ranges so RUSTSEC-2026-0385, RUSTSEC-2026-0381, and RUSTSEC-2026-0386 no longer fail CI.

Co-authored-by: Uriah Galang <[email protected]>
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.

2 participants