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

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

Closed
kostasrim opened this issue Nov 30, 2021 · 2 comments
Closed
Labels
🎉 enhancement New feature or request

Comments

@kostasrim
Copy link

kostasrim commented Nov 30, 2021

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 kostasrim added the 🎉 enhancement New feature or request label Nov 30, 2021
@jcaesar
Copy link
Contributor

jcaesar commented Jan 28, 2022

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.

@kostasrim
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants