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

ruby.wasm doesn't work on Wasmer 3.0 #116

Closed
koduki opened this issue Nov 27, 2022 · 3 comments
Closed

ruby.wasm doesn't work on Wasmer 3.0 #116

koduki opened this issue Nov 27, 2022 · 3 comments

Comments

@koduki
Copy link

koduki commented Nov 27, 2022

Summary

I tried to execute ruby.wasm via below commands on wasmer 3.0.1, but it doesn't work.

$ wasmer --version
wasmer 3.0.1
$ wasmer run ./ruby.wasm -- --version
thread 'main' panicked at 'not yet implemented: could not serialize number 2 to enum Clockid', lib/wasi-types/src/wasi/extra.rs:2725:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It worked on wasmer 2.3.0 and wasmtime 3.0.0.

$ curl https://get.wasmer.io -sSfL | sh -s "2.3.0"
$ wasmer --version
wasmer 2.3.0
$ wasmer run ./ruby.wasm -- --version
ruby 3.2.0dev (2022-11-11T22:40:31Z master 0a9d51ee9d) [wasm32-wasi]
$ wasmtime --version
wasmtime-cli 3.0.0
$ wasmtime run ./ruby.wasm -- --version
ruby 3.2.0dev (2022-11-11T22:40:31Z master 0a9d51ee9d) [wasm32-wasi]

I don't have confidence this issue is ruby problem or wasmer problem, but wasmer 3.0.2 can execute some WASM which are created by Rust. So, I report it here.

Environments and install

OS

3.2.0-preview3-bullseye(Docker)

ruby.wasm

$ curl -LO https://github.com/ruby/ruby.wasm/releases/latest/download/ruby-head-wasm32-unknown-wasi-full.tar.gz
$ tar xfz ruby-head-wasm32-unknown-wasi-full.tar.gz
$ mv head-wasm32-unknown-wasi-full/usr/local/bin/ruby ruby.wasm

wasmer

$ curl https://get.wasmer.io -sSfL | sh
$ wasmer --version
wasmer 3.0.1

Expectation

success to run ruby.wasm

$ wasmer run ./ruby.wasm -- --version
ruby 3.2.0dev (2022-11-11T22:40:31Z master 0a9d51ee9d) [wasm32-wasi]

Actual Error

$ wasmer run ./ruby.wasm -- --version
thread 'main' panicked at 'not yet implemented: could not serialize number 2 to enum Clockid', lib/wasi-types/src/wasi/extra.rs:2725:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@kateinoigakukun
Copy link
Member

Thanks for reporting. This is apparently wasmer's issue because wasmer 3.0.2 has incompatibilities with WASI spec for now.
Wasmer is mixing legacy ABI and latest ABI for clock id, and Ruby uses a clock id defined only in the latest ABI.
I know it would be a practical issue because wasmer is one of the most popular wasm runtimes unfortunately, but I don't want to introduce workarounds only for a specific runtime.

Could you report it to wasmer side?

@koduki
Copy link
Author

koduki commented Nov 29, 2022

Thank you for your reply and forward issue to wasmer! Should I close this project?

@kateinoigakukun
Copy link
Member

kateinoigakukun commented Nov 30, 2022

Looks like it's fixed in wasmer side :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants