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

feat(wamr): add wasm-mico-runtime shim implementation #508

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Mossaka
Copy link
Member

@Mossaka Mossaka commented Mar 7, 2024

this commit adds an additional shim implementation: Wamr using wamr-rust-sdk. At the moment, the shim isn't working with an error "thread signal env initialized failed" which I am not sure exactly sure what it means. Will ask the Wamr team for clarification. There are also some pain points using the newly created wamr-rust-sdk which I wrote as TODOs in the comment.

This PR should close #337

FYI @squillace @0xE282B0 @lum1n0us

this commit adds an additional shim implementation: Wamr using
wamr-rust-sdk

Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
@@ -3,7 +3,7 @@ INSTALL ?= install
CARGO ?= cargo
LN ?= ln -sf
TEST_IMG_NAME ?= wasmtest:latest
RUNTIMES ?= wasmedge wasmtime wasmer
RUNTIMES ?= wasmedge wasmtime wasmer wamr
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add wamr to CI

@squillace
Copy link

this is GREAT!

Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
let instance = WamrInstnace::new(&module, 1024 * 64)
.map_err(|e| anyhow::Error::msg(format!("Failed to create instance: {:?}", e)))?;

// TODO: bug: failed at line above saying: `thread signal env initialized failed`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about Self { runtime } may has been destroyed. It happened several times in my test cases when implementing rust-sdk. Is there a quick way we can confirm that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i believe that when the variable let runtime = Runtime::new() goes out of scope, the Drop() will be invoked to destruct it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's probably why I favor the design of a binding the runtime to the variable and pass that to instances like wasmtime does.

    let engine = Engine::default();
    let module = Module::new(&engine, wat)?;
    let mut store = Store::new(&engine, 4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

Add webassembly-micro-runtime support
3 participants