spin icon indicating copy to clipboard operation
spin copied to clipboard

Modules with duplicate imports cannot be componentized

Open lann opened this issue 1 year ago • 1 comments

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.

lann avatar Aug 28 '24 15:08 lann

It turns out this is only an issue for Grain with debug builds. Compiling with --release solves the problem.

lann avatar Aug 28 '24 16:08 lann

@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?

vdice avatar Nov 04 '24 17:11 vdice

No my understanding is that this is working as intended on the wasmtime side.

lann avatar Nov 04 '24 17:11 lann