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

Implement support for running wasm32-wasi compiled Wasm binaries #358

Closed
Robbepop opened this issue Feb 12, 2022 · 9 comments · Fixed by #557
Closed

Implement support for running wasm32-wasi compiled Wasm binaries #358

Robbepop opened this issue Feb 12, 2022 · 9 comments · Fixed by #557
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Robbepop
Copy link
Member

Robbepop commented Feb 12, 2022

The WebAssembly System Interface (WASI) is an important part at enabling support for a wide variety of WebAssembly targets.
With wasmi_v1 and its Linker definition it should be very straight forward to implement WASI support for the wasmi interpreter.

Ideally the entire WASI implementation resides in a new sub-crate of the wasmi workspace, called wasi.
This sub-crate implements the WASI interface and provides extension methods for the wasmi_v1::Linker to add WASI support.

As a follow-up feature we could provide an executable for wasmi_v1 that runs input .wasm or .wat files using WASI support out of the box as it is done in Wasmtime.

As an overview of what needs to be implemented you can inspect: https://doc.rust-lang.org/std/os/wasi/index.html
The Wasmtime implementation of WASI is also a place to look out for inspiration. Technically we could also use it as a common ground for our WASI support.

Wasmtime reference API guide: https://docs.wasmtime.dev/examples-rust-wasi.html
WASI proposals: https://github.com/WebAssembly/WASI/blob/main/Proposals.md

@Robbepop Robbepop added enhancement New feature or request help wanted Extra attention is needed wasmi-v1 labels Feb 12, 2022
@OLUWAMUYIWA
Copy link
Contributor

Would certainly love to work on this @Robbepop

@Robbepop
Copy link
Member Author

Robbepop commented Sep 18, 2022

Would certainly love to work on this @Robbepop

I would certainly appreciate help with this issue!
Please feel free to let me know what you need to know and how I can help you with work on this. :)

As a follow-up feature we could provide an executable for wasmi_v1 that runs input .wasm or .wat files using WASI support out of the box as it is done in Wasmtime.

The situation here has significantly improved since creation of the issue since we now have wasmi_cli which is a CLI tool to invoke .wasm and .wat files using wasmi. Therefore as a follow-up we really would love for this CLI tool to have WASI support out of the box.
Link to wasmi_cli: https://github.com/paritytech/wasmi/tree/master/cli

@OLUWAMUYIWA
Copy link
Contributor

Thanks!
I will implement it in drafts. If I need help, I'll let you know.

@Robbepop
Copy link
Member Author

In case you were not already aware of the Wasmtime wasi-common crate:
https://crates.io/crates/wasi-common/1.0.0

I think it might suite as a good foundation for WASI support in wasmi.

@OLUWAMUYIWA
Copy link
Contributor

Yes I found it while looking around. I'm making use of it. Thanks!

@Robbepop Robbepop changed the title Implement WASI support Implement support for running wasm32-wasi compiled Wasm binaries Sep 23, 2022
@Robbepop
Copy link
Member Author

@OLUWAMUYIWA how is it going with the wasmi WASI implementation so far? Do you need any help or can we somehow support you?

@OLUWAMUYIWA
Copy link
Contributor

Hi Rob. Apologies. I got stuck at some point. Rather than getting unstuck, I paused and got busier. Still interested. Will pick it up again tomorrow, and ask you some questions. Is there a discord?

@Robbepop
Copy link
Member Author

Robbepop commented Oct 18, 2022

Thank you for the response @OLUWAMUYIWA . Looking forward to answer all your questions. :) I was just curious which is why I asked. The folks at CNCF would really love to have WASI support for wasmi though. ^.^

@Robbepop Robbepop removed the wasmi-v1 label Oct 25, 2022
@Robbepop
Copy link
Member Author

Robbepop commented Oct 26, 2022

@OLUWAMUYIWA I just sent you an e-Mail with my Discord handle. :) (Did not want to post that publicly here.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants