wasix-org/cargo-wasix

Cannot publish to wasmer

mikeymop opened this issue · 2 comments

Hello, I have been trying to publish to wasmer.io following the wasix guide.

I have added the wasm32-wasmer-wasi target but am under the understanding I can publish wasix binaries to wasmer as well?

When I build my project with cargo wasix buid --release I get a binary in ./target/wasm32-wasmer-wasi/release/foo.wasm.

My wasmer.toml contains the following:

[[module]]
name = 'foo'
source = './target/wasm32-wasmer-wasi/release/foo.wasm'
abi = 'wasi'

However when I try to wasmer publish I get the following error:

error: WASM file "/home/***/target/wasm32-wasmer-wasi/release/foo.wasm" detected as invalid because InterfaceViolated { errors: ["Missing import \"wasix_32v1\" \"thread_exit\"", "Missing import \"wasix_32v1\" \"futex_wait\"", "Missing import \"wasix_32v1\" \"thread_signal\"", "Missing import \"wasix_32v1\" \"futex_wake_all\"", "Missing import \"wasix_32v1\" \"futex_wake\"", "Missing import \"wasix_32v1\" \"getcwd\"", "Missing import \"wasix_32v1\" \"callback_signal\""] }

However I can

$ wasmer run /home/***/target/wasm32-wasmer-wasi/release/foo.wasm
Hello, world!

So the binary is definitely located at that path. Is there another target I need in order to publish to wasmer.io? Is it required to use the wasi target? Or are wasix binaries also allowed?

@mikeymop you can work around this with wasmer publish --no-validate .

(it's a known bug, we'll need to fix this soon)

This did the trick. The package appears on wasmer.io as using the wasi abi and I can run it using wasmer run. Thank you!