-
Notifications
You must be signed in to change notification settings - Fork 757
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
Experimental: Add interpreter support for Wasmer #4515
base: main
Are you sure you want to change the base?
Conversation
#[cfg_attr( | ||
feature = "wasm-c-api", | ||
ignore = "wasm-c-api has a different memory testuite" | ||
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably remove this, since we are skipping the failing tests
@@ -128,6 +124,7 @@ default = ["wat", "wast", "cache", "wasi", "engine", "emscripten", "middlewares" | |||
# That means: that is able to execute modules | |||
backend = [] | |||
jsc = ["wasmer/jsc", "backend", "wat", "wasmer/std"] | |||
wasm-c-api = ["wasmer/wasm-c-api", "backend", "wat", "wasmer/std"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a new one: wamr = ["wasm-c-api"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feat(api): Update WAMR
@@ -98,7 +98,7 @@ fn main() -> anyhow::Result<()> { | |||
Ok(()) | |||
} | |||
Err(e) => { | |||
bail!("Unknown error `{}` found. expected `ErrorCode`", e); | |||
bail!("Unknown error `{}` found. expected `ExitCode`", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
lib/api/Cargo.toml
Outdated
default = ["sys-default"] | ||
# default = ["js-default"] | ||
# default = ["sys-default"] | ||
default = ["wasm-c-api"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep the defaults once everything is passing
@@ -0,0 +1,50 @@ | |||
fn main() { | |||
#[cfg(feature = "wasm-c-api")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shoudl do here wamr
feature instead of wasm-c-api
lib/api/build.rs
Outdated
let bindings = bindgen::Builder::default() | ||
.header("wasm.h") | ||
// This is needed if use `#include <nng.h>` instead of `#include "path/nng.h"` | ||
//.clang_arg("-Inng/src/") | ||
.generate() | ||
.expect("Unable to generate bindings"); | ||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
bindings | ||
.write_to_file(out_path.join("bindings.rs")) | ||
.expect("Couldn't write bindings"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the wasm-c-api
feature (not wamr)
unimplemented!() | ||
// let error = Trap::user(error); | ||
// let js_error: JsValue = error.into(); | ||
// wasm_bindgen::throw_val(js_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably do the same implementation as jsc
impl PrettyError { | ||
/// Process a `Result` printing any errors and exiting | ||
/// the process after | ||
pub fn report<T>(result: Result<T, Error>) -> ! { | ||
use wasmer::RuntimeError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the import up, and do it with a cfg decorator instead?
… back when instantiating a module
This PR adds support for running Wasm modules in interpreted mode (in this case, via WAMR).
Progress: