-
Notifications
You must be signed in to change notification settings - Fork 295
Description
Multiple imports of the same name are in-spec for core-wasm modules but not allowed for components. Currently, attempting to componentize a module with non-uniquely named imports yields…
% wasm-tools component new main-with-dupe-imports.wasm -o component-with-dupes.wasm --adapt wasi_snapshot_preview1.wasm
error: failed to encode a component from module
Caused by:
0: failed to decode world from module
1: module was not valid
2: module has duplicate import for `wasi_snapshot_preview1::fd_write`
We should pick a unique import of each name and ignore the rest when componentizing. Since inter-component linking is done solely by name, multiple same-named imports have no way of being distinguished in order to be satisfied individually—even if they had unique types, for example—and so nothing is lost by ignoring them.
Metadata
Metadata
Assignees
Labels
No labels