Stream: git-wasmtime

Topic: wasmtime / PR #14918 [DO NOT REVIEW] Support named import...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:19):

jrandolf opened PR #14918 from jrandolf:wasi-keyvalue-named-imports to bytecodealliance:main:

This builds on #14875, so only the last commit is new here.

Components importing wasi:keyvalue interfaces under a label couldn't be linked with wasmtime-wasi-keyvalue. Its bindings are private, so embedders couldn't do it themselves either. This adds add_named_to_linker, following the named-import support in wasmtime-wasi (#14275).

wasmtime-wasi-keyvalue now depends on wasmtime-wasi (it was a dev-dependency) to share its NamedId. That grows its dependency tree from 81 to 151 crates, so I'd appreciate a second opinion on whether that's the right way to share it.

Part of #14858

<details>
<summary>LLM summary of the changes</summary>

API

Implementation

The bindings get named_imports for the three interfaces. Each named method looks up the context for the id and calls the existing implementation. The convert_error conversions take the id because of #14875.

Dependency

wasmtime-wasi moves from dev-dependencies to dependencies, for NamedId (a usize newtype) and WasiCtxNamedView (a one-field wrapper). It's used without default features, but its non-optional dependencies such as tokio still come along. Cargo.lock doesn't change.

Interaction with #14873

#14873 changes the signature of the add_named_to_linker lookup. Whichever of the two lands second needs to port this function, which is mechanical.

Test

keyvalue_named_imports runs a new guest program with two labelled wasi:keyvalue/store imports, each backed by its own in-memory data, and checks that the labels get separate contexts.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:28):

jrandolf commented on PR #14918:

Closing: nobody needs labelled wasi:keyvalue imports yet, and wasi:keyvalue isn't part of a WASI release. Happy to revisit if someone asks.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:28):

:cross_mark: jrandolf closed without merge PR #14918.


Last updated: Oct 31 2026 at 23:03 UTC