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/c@0.2.1 with its alternate key a:b/c@0.2. But if the component is importing a:b/c@0.2, we cannot match it back with a:b/c@0.2.1. 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 #14344 (comment)
When
-W component-model-canonical-namesfeature 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.NameMapcurrently supports matchinga:b/c@0.2.1with its alternate keya:b/c@0.2. But if the component is importinga:b/c@0.2, we cannot match it back witha:b/c@0.2.1. We need to refactorNameMap/alternate_lookup_keyto 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-bindgento emit canonical names. But when the component is importing a full version,NameMapneeds to know how to match it with the canonical name.Raised from #14344 (comment)