wasmer-java icon indicating copy to clipboard operation
wasmer-java copied to clipboard

Bump up WASI version to enable "wasi-snapshot-preview1"."proc_exit"

Open kostasrim opened this issue 3 years ago • 1 comments

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.

kostasrim avatar Nov 30 '21 09:11 kostasrim

Two jumbled things here:

  • You're trying to bump the wasmer version, not the wasi version. There's a PR for that.
  • wasmer-java doesn't support imports at all. There's an issue with some unfinished code for that.

jcaesar avatar Jan 28 '22 04:01 jcaesar

Thank you @jcaesar. I somehow forgot to reply and just noticed -- I am closing this :)

kostasrim avatar Jul 13 '23 19:07 kostasrim