Open lann opened 2 months ago
If you run grain compile <file> --release
it will produce a module without multiple imports.
To add to what @spotandjake mentioned, we have successfully used the adapter to make components. Let me know if you want some pointers!
We've been aware of this issue but have been slow to fix it because of the available workaround. This is something we can resolve in the next major release.
Aha thanks! Feel free to resolve this unless you'd like to keep it for tracking.
Grain produces Wasm modules with duplicate imports. This is permitted by the Wasm core spec, but with caveats:
https://webassembly.github.io/spec/core/syntax/modules.html#imports
The Wasm Component Model in particular does not support duplicate imports, which means that WASI preview1 modules compiled with Grain cannot be converted to components with the preview1 adapter.
Example: