Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use core wasm module functionalities along with component wasm ? #8513

Open
redoC-A2k opened this issue May 1, 2024 · 1 comment

Comments

@redoC-A2k
Copy link

redoC-A2k commented May 1, 2024

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 ?

@redoC-A2k redoC-A2k changed the title Is it possible to use core wasm module functionalities from component wasm ? Is it possible to use core wasm module functionalities along with component wasm ? May 1, 2024
@alexcrichton
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants