Stream: wit-bindgen

Topic: wasm-tool componet new with shared memory


view this post on Zulip Scott Waye (May 20 2023 at 13:48):

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)

view this post on Zulip Alex Crichton (May 22 2023 at 14:31):

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

view this post on Zulip Scott Waye (May 22 2023 at 14:50):

Assuming then that threads were not used or required (even though the thread target was used), how would you fix this?

view this post on Zulip Alex Crichton (May 22 2023 at 14:52):

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.

view this post on Zulip Scott Waye (May 24 2023 at 02:05):

So there is no way to turn on the threads_enabled which exists in the config ?


Last updated: Nov 22 2024 at 17:03 UTC