wasmer icon indicating copy to clipboard operation
wasmer copied to clipboard

How to Add custom function along with wasi

Open newNcy opened this issue 10 months ago • 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.

newNcy avatar Apr 23 '24 08:04 newNcy

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.

syrusakbary avatar Apr 23 '24 08:04 syrusakbary

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

newNcy avatar Apr 23 '24 08:04 newNcy

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

newNcy avatar Apr 23 '24 08:04 newNcy