Hello. I'm evaluating wasmex for a corporate project that involves running javascript compiled into wasm via Javy. I found that a very similar test component (one taken from the Javy documentation) causes a panic in 0.14.0 but runs fine in 0.13.0. The panic is:
thread 'wasmex-async' (108257044) panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-wasi-39.0.1/src/runtime.rs:108:15:
Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
I can't attach the .wasm file, but here are steps to repro, with code:
- Save
index.js as
export function foo() {
console.log("Hello from foo!");
}
console.log("Hello world!");
and index.wit as
package local:main;
world index-world {
export foo: func();
}
javy build index.js -C wit=index.wit -C wit-world=index-world -o index.wasm
wasm-tools component embed index.wit index.wasm --world index-world -o index.embedded.wasm
wasm-tools component new index.embedded.wasm --adapt wasi_snapshot_preview1.reactor.wasm -o index.component.wasm with the version-appropriate reactor.wasm from wasmtime
Then run the following:
Mix.install([{:wasmex, "0.14.0"}])
bytes = File.read!("index.component.wasm")
{:ok, pid} = Wasmex.Components.start_link(%{bytes: bytes, wasi: %Wasmex.Wasi.WasiP2Options{}})
{:ok, result} = Wasmex.Components.call_function(pid, "foo", [])
In 0.13.0 this will correctly log and return. In 0.14.0 it panics.
Hello. I'm evaluating wasmex for a corporate project that involves running javascript compiled into wasm via Javy. I found that a very similar test component (one taken from the Javy documentation) causes a panic in 0.14.0 but runs fine in 0.13.0. The panic is:
I can't attach the .wasm file, but here are steps to repro, with code:
index.jsasand
index.witasjavy build index.js -C wit=index.wit -C wit-world=index-world -o index.wasmwasm-tools component embed index.wit index.wasm --world index-world -o index.embedded.wasmwasm-tools component new index.embedded.wasm --adapt wasi_snapshot_preview1.reactor.wasm -o index.component.wasmwith the version-appropriatereactor.wasmfrom wasmtimeThen run the following:
In 0.13.0 this will correctly log and return. In 0.14.0 it panics.