fermyon / spin

Spin is the open source developer tool for building and running serverless applications powered by WebAssembly.
https://developer.fermyon.com/spin
Apache License 2.0
5.14k stars 248 forks source link

Modules with duplicate imports cannot be componentized #2778

Open lann opened 2 weeks ago

lann commented 2 weeks ago

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:

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 commented 2 weeks ago

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