You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am very new to the wasm ecosystem and trying a bit all the tools/framework/runtime out there.
I am working on porting https://github.com/cloudflare/sliceslice-rs to wasm.
That project requires simd instructions to work.
I have a wip branch working but to run the tests, I cannot simple do:
$ cargo wasi test
Finished test [unoptimized + debuginfo] target(s) in 0.00s
Running unittests (target/wasm32-wasi/debug/deps/sliceslice-c22d039e805d5bb0.wasm)
Running tests/i386.rs (target/wasm32-wasi/debug/deps/i386-310c1b29d531f32f.wasm)
Running `/home/adema/code/sliceslice-rs/target/wasm32-wasi/debug/deps/sliceslice-c22d039e805d5bb0.wasm`
Error: failed to run main module `/home/adema/code/sliceslice-rs/target/wasm32-wasi/debug/deps/sliceslice-c22d039e805d5bb0.wasm`
Caused by:
0: WebAssembly translation error
1: Invalid input WebAssembly code at offset 337919: SIMD support is not enabled
because the simd feature of wasmtime is not enabled by default.
My problem is that I haven't found a way to enable simd from cargo-wasi.
To run the tests, I have to manually run:
$ wasmtime --enable-simd /home/adema/code/sliceslice-rs/target/wasm32-wasi/debug/deps/sliceslice-c22d039e805d5bb0.wasm
running 14 tests
test tests::memchr_search_different ... ok
test tests::memchr_search_middle ... ok
test tests::memchr_search_mutiple ... ok
test tests::memchr_search_prefix ... ok
test tests::memchr_search_same ... ok
test tests::memchr_search_suffix ... ok
test tests::needle_array_size ... ok
test tests::needle_slice_size ... ok
test wasm32::tests::search_different ... ok
test wasm32::tests::search_middle ... ok
test wasm32::tests::search_multiple ... ok
test wasm32::tests::search_prefix ... ok
test wasm32::tests::search_same ... ok
test wasm32::tests::search_suffix ... ok
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
but that requires finding the wasm binary path which is not easily predictable.
My question is then: is there a way to pass command line options to wasmtime?
I can see different options if that's not already implemented:
by specifying cargo metadata variable
by using an environment variable like WASMTIMEFLAGS
by specifying command line arguments tocargo wasi test
Thank you in advance for taking the time to read this 👍
The text was updated successfully, but these errors were encountered:
Thanks for the report! This isn't supported well today unfortunately. Some initial work was done at #19 but it stalled out because I don't think there's an idea of what the best design for this is right now.
From a user perspective, I think I would prefer the cargo metadata option the most because I think people should not have to know which wasmtime features to enable or disable.
If you agree with this, and if we restrict ourselves to specifying only wasmtime features, how much work do you think it would be?
@alexcrichton I don't know exactly what changed but I am now able to run cargo wasi without problem! Maybe the simd feature is enabled by default now?
Anyway, that's really neat, I was able to port sliceslice to wasm32 👍
Hello!
I am very new to the wasm ecosystem and trying a bit all the tools/framework/runtime out there.
I am working on porting https://github.com/cloudflare/sliceslice-rs to wasm.
That project requires simd instructions to work.
I have a wip branch working but to run the tests, I cannot simple do:
because the simd feature of wasmtime is not enabled by default.
My problem is that I haven't found a way to enable simd from cargo-wasi.
To run the tests, I have to manually run:
but that requires finding the wasm binary path which is not easily predictable.
My question is then: is there a way to pass command line options to wasmtime?
I can see different options if that's not already implemented:
cargo wasi test
Thank you in advance for taking the time to read this 👍
The text was updated successfully, but these errors were encountered: