wac icon indicating copy to clipboard operation
wac copied to clipboard

Enable composing components that use GC

Open gertvv opened this issue 8 months ago • 3 comments

For example, plugging a component with wasm-gc internals into a wasi-cli command:

$ wac plug command-incomplete.wasm --plug gc_component.wasm  -o command.wasm
error: struct indexed types not supported without the gc feature (at offset 0x16)

I couldn't find any flag to enable GC support.

gertvv avatar May 10 '25 17:05 gertvv

@gertvv It is fixed by https://github.com/bytecodealliance/wac/pull/146 Unfortunately, the new version hasn't yet released, use cargo install --git https://github.com/bytecodealliance/wac wac-cli

tanishiking avatar Jun 12 '25 08:06 tanishiking

Let me know if this works in the latest 0.7.0 release.

calvinrp avatar Jun 25 '25 19:06 calvinrp

I didn't have my original example any longer, but I was able to implement the "reverse" part of the jco string-reverse-upper example in WAT using GC arrays and compose it with the JS compiled to WASM outer component without problems. I'm happy to share the example if useful.

Edit: I've published it as the addendum here: https://github.com/gertvv/wasm-component-raw/

gertvv avatar Jun 30 '25 06:06 gertvv