#14346·wasmtime

Link host-side interface with canonical names

Author: chenyan2002Created Sep 16, 2026Updated Sep 16, 2026
Labelswasm-proposal:component-model

When -W component-model-canonical-names feature is enabled, the guest side component encodes interface names with canonical names, while the host-side bindgen is still using the full version. This causes the linking to fail.

NameMap currently supports matching a:b/[email protected] with its alternate key a:b/[email protected]. But if the component is importing a:b/[email protected], we cannot match it back with a:b/[email protected]. We need to refactor NameMap/alternate_lookup_key to be able to handle both canonical version and full version during the transition period.

Another fix is to add an option in the host side wit-bindgen to emit canonical names. But when the component is importing a full version, NameMap needs to know how to match it with the canonical name.

Raised from https://github.com/bytecodealliance/wasmtime/pull/14344#discussion_r4019873593

Source: bytecodealliance/wasmtime