Can wasm-tools component new
encode a module with shared memory, ie with threads. I'm getting this error
PS C:\github\cswasi> wasm-tools component new .\bin\Debug\net8.0\wasi-wasm\native\cswasi.wasm -o my-component-cs.wasm --adapt wasi_snapshot_preview1=c:\github\rustimpl\rustimpl\wasi_preview1_component_adapter.reactor.wasm
error: failed to encode a component from module
Caused by:
0: threads must be enabled for shared memories (at offset 0x3d8)
While this specific error is probably fixable threads won't work for components in general as there is no way to implement a host thread spawn function which core wasm requires
Assuming then that threads were not used or required (even though the thread target was used), how would you fix this?
Otherwise I think this is related to https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/Error.20.22module.20is.20only.20allowed.20to.20import.20functions.22/near/359907665. It's possible to solve this with the component model but I'm not aware of any ready-made tooling which you can pull off the shelf and use.
So there is no way to turn on the threads_enabled
which exists in the config
?
Last updated: Dec 23 2024 at 12:05 UTC