wasmerio/wasmer

How to Add custom function along with wasi

Opened this issue · 3 comments

Summary

after add a custom import function in wasm, the c-api wasi_get_imports will failed to resolve that import

Additional details

Provide any additional details here.

This should be trivial to do, but unfortunately it is not, mainly due to WASI imports require to be clonable/usable across different threads.
We may need to add a way to generate imports easily for WASI, and/or make the imports Send/Sync for WASI.

So far we haven't found an elegant solution for this, but will post once we do.

This should be trivial to do, but unfortunately it is not, mainly due to WASI imports require to be clonable/usable across different threads. We may need to add a way to generate imports easily for WASI, and/or make the imports Send/Sync for WASI.

So far we haven't found an elegant solution for this, but will post once we do.

so what i need to do for that purpose

Why can't we just generate what wasi has and let the developer define the rest?