-
Notifications
You must be signed in to change notification settings - Fork 15
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
Finish implementing the wasm3 runtime #266
Conversation
@jonas-schievink, did you want to add the code for propagating errors to this PR before we merge it? Or should I merge it now and we'll add error handling later? |
I'd prefer to land this now so that #271 is unblocked |
Perfect. It looks like you just need to |
Head branch was pushed to by a user without write access
a9e3c44
to
74b74fd
Compare
@Michael-F-Bryan looks like you need to re-approve the PR for auto-merging to work |
This adds a
--wasm3
option torune run
, and duplicates the Wasmer API implementation for wasm3. It also updates to wasm3 0.2, which fixes the soundness bug I encountered last time.The result:
There are some caveats due to limitations of the wasm3 crate: it doesn't have a very sophisticated interface for building host functions, so I had to manually implement some wrappers that resemble what Wasmer offers here. The crate also doesn't have a way to bubble up runtime errors, which means that an error in a host function results in the WASM binary continuing to run (currently I log the error that occurred and return
u32::MAX
to the WASM program).The "all intrinsics are implemented" test from the wasmer implementation has been configured out for now, since wasm3 does not have the required introspection APIs.