Stream: git-wasmtime

Topic: wasmtime / issue #8513 Is it possible to use core wasm mo...


view this post on Zulip Wasmtime GitHub notifications bot (May 01 2024 at 03:12):

redoC-A2k opened issue #8513:

Suppose I wrote some code in rust which have exported extern functions annonated #[export_name = "..."] macro and I also have trait implmentation of exported functions through wit .
So after doing compilation to wasm using cargo build --target=wasm32-wasi , I get core wasm module which then I convert to component model using `wasm-tools component new ... adapt ... .
Now in my main function in host I want to call both annonated exported function as well as exported through wit .

How can I ?

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2024 at 03:12):

redoC-A2k edited issue #8513:

Suppose I wrote some code in rust which have exported extern functions annonated #[export_name = "..."] macro and I also have trait implmentation of exported functions through wit .
So after doing compilation to wasm using cargo build --target=wasm32-wasi , I get core wasm module which then I convert to component model using wasm-tools component new ... adapt ...
Now in my main function in host I want to call both annonated exported function as well as exported through wit .

How can I ?

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2024 at 08:16):

redoC-A2k edited issue #8513:

Suppose I wrote some code in rust which have exported extern functions annonated #[export_name = "..."] macro and I also have trait implmentation of exported functions through wit .
So after doing compilation to wasm using cargo build --target=wasm32-wasi , I get core wasm module which then I convert to component model using wasm-tools component new ... adapt ...
Now in my main function in host I want to call both annonated exported function as well as exported through wit .

How can I ?

view this post on Zulip Wasmtime GitHub notifications bot (May 02 2024 at 17:45):

alexcrichton commented on issue #8513:

I believe the general answer to your question is "no". A component has its own exports/imports and you can't reach inside and fiddle with internal modules through a component boundary. You'd need to have custom WIT to model your custom #[export_name] for that to get plumbed through the componentization process.


Last updated: Nov 22 2024 at 17:03 UTC