Stream: git-wasmtime

Topic: wasmtime / PR #14917 [DO NOT REVIEW] Add synchronous name...


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

jrandolf opened PR #14917 from jrandolf:wasi-named-imports-sync to bytecodealliance:main:

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

Named imports were only supported with the async bindings of wasmtime-wasi and wasmtime-wasi-http. This adds wasmtime_wasi::p2::add_named_to_linker_sync and wasmtime_wasi_http::p2::add_named_to_linker_sync (each with a _with_options variant). I didn't find a technical reason these were left out. The sync bindings alias most interfaces to the async ones, and the rest have sync implementations that the named ones can call.

Part of #14858

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

Bindings (wasi/src/p2/bindings.rs)

The sync bindings get named_imports for the interfaces they don't alias to the async bindings: wasi:io/{poll,streams}, wasi:filesystem/types, and wasi:sockets/{tcp,udp,udp-create-socket,ip-name-lookup}. The generated named_imports module is re-exported from bindings::sync.

Linking (wasi/src/p2/mod.rs, wasi-http/src/p2/mod.rs)

Implementation

For each interface above, the sync named implementation looks up the context for the id and calls the existing sync implementation. That covers p2/host/io.rs, filesystem/sync.rs, tcp.rs, udp.rs, udp_create_socket.rs, ip_name_lookup.rs and poll.rs.

Interaction with #14873

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

Tests

</details>

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

jrandolf commented on PR #14917:

Closing: #14275 left named imports out of the sync bindings on purpose, and nothing needs them, so this isn't worth the extra code.

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

:cross_mark: jrandolf closed without merge PR #14917.


Last updated: Oct 31 2026 at 23:03 UTC