jrandolf opened PR #14919 from jrandolf:wasi-config-named-imports to bytecodealliance:main:
Components importing
wasi:config/storeunder a label couldn't be linked with wasmtime-wasi-config. Its bindings are private, so embedders couldn't do it themselves either. This addsadd_named_to_linker, following the named-import support in wasmtime-wasi (#14275).wasmtime-wasi-config now depends on
wasmtime-wasi(it was a dev-dependency) to share itsNamedId. That grows its dependency tree from 77 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
WasiConfigNamedViewmaps aNamedIdto theWasiConfigcontext to use.InterfacehasConfigStore.add_named_to_linkeradds every labelled import ofwasi:config/storethat the component has, askinglookupfor each one's id.Implementation
The bindings get
named_importsforwasi:config/store. Each named method looks up the context for the id and calls the existing implementation.Dependency
wasmtime-wasimoves from dev-dependencies to dependencies, forNamedId(ausizenewtype) andWasiCtxNamedView(a one-field wrapper). It's used without default features, but its non-optional dependencies such as tokio still come along.Cargo.lockdoesn't change.Interaction with #14873
#14873 changes the signature of the
add_named_to_linkerlookup. Whichever of the two lands second needs to port this function, which is mechanical.Test
config_named_importsruns a new guest program with two labelledwasi:config/storeimports, each with its own variables, and checks that the labels get separate contexts.</details>
jrandolf commented on PR #14919:
Closing: nobody needs labelled
wasi:configimports yet, andwasi:configisn't part of a WASI release. Happy to revisit if someone asks.
:cross_mark: jrandolf closed without merge PR #14919.
Last updated: Oct 31 2026 at 23:03 UTC