wasmer-java
wasmer-java copied to clipboard
Bump up WASI version to enable "wasi-snapshot-preview1"."proc_exit"
Motivation
I compiled a C library to wasm which contains the following import (in the .wat file)
(import "wasi-snapshot-preview1" "proc_exit" (func (;0;) (type 4)))
However, when I later use this module with java-wasmer I get the following errors:
Exception in thread "main" java.lang.RuntimeException: Failed to instantiate the module: Error while importing "wasi-snapshot-preview1"."proc_exit": unknown import. Expected Function(FunctionType { params: [I32], results: [] }).
Currently, from Cargo.toml it appears that wasmer-java is using an older version of WASI and I tried to compile wasmer-java with the updated packages:
11 [dependencies]
12 wasmer = { git = "https://github.com/wasmerio/wasmer", rev = "2.0.0" }
13 wasmer-runtime = { git = "https://github.com/wasmerio/wasmer", rev = "1.0.0" }
14 wasmer-runtime-core = { git = "https://github.com/wasmerio/wasmer", rev = "1.0.0" }
but make fails. Is there an easy way to bump up the versions?
Proposed solution
Update the WASI package versions to allow accessing the undefined WASI functions.
Alternatives
There aren't any.
Additional context
Nothing here as well. It's package versioning.
Two jumbled things here:
Thank you @jcaesar. I somehow forgot to reply and just noticed -- I am closing this :)