spin
spin copied to clipboard
Modules with duplicate imports cannot be componentized
This is only known to be a problem for Grain where a Hello World wasi preview1 module produces duplicate fd_write imports.
Duplicate imports are permitted in modules by the Wasm core spec but forbidden by the component model, which prevents these modules from being componentized.
Two plausible paths to fix this:
- Get Grain to deduplicate imports in the compiler: https://github.com/grain-lang/grain/issues/2152
- Build tooling to deduplicate imports
While fixing Grain is probably independently a good idea, we don't necessarily control that timing and it wouldn't help for existing modules. A discussion of how to build dedupe tooling can be found in BA Zulip.
It turns out this is only an issue for Grain with debug builds. Compiling with --release solves the problem.
@lann now that the grain template and language page have been updated to use --release, do we still want to keep this open? Untether from Spin 3.0 if so?
No my understanding is that this is working as intended on the wasmtime side.