Wasm Builders 🧱

Discussion on: Compiling Javascript to wasm

Collapse
 
developerworks profile image
developerworks
t@iZj6ceuntkc5q6r6ip9tdaZ:~/demo# json2msgpack -i input.json | wasmtime run index.wasm | msgpack2json
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: EOF while parsing a value at line 2 column 0', crates/core/src/main.rs:51:72
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `index.wasm`

Caused by:
    0: failed to invoke command default
    1: wasm trap: wasm `unreachable` instruction executed
       wasm backtrace:
           0: 0x11167 - <unknown>!<wasm function 191>
           1: 0x19631 - <unknown>!<wasm function 316>
           2: 0x11ce - <unknown>!<wasm function 24>
           3: 0x18df - <unknown>!<wasm function 30>
           4: 0x9c05 - <unknown>!<wasm function 125>
           5: 0x961d - <unknown>!<wasm function 123>
           6: 0xbd0d6 - <unknown>!<wasm function 1165>

msgpack2json: parse error: mpack_error_io (2
Enter fullscreen mode Exit fullscreen mode

What is the issue about this errors follow your article.

Toolchains:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

rustup 1.24.3 (ce5817a94 2021-05-31)
rustc 1.60.0 (7737e0b5c 2022-04-04)
cargo 1.60.0 (d1fd9fe 2022-03-01)
wasmtime 0.36.0
cargo-wasi 0.1.23 (aa58e595d4 2021-07-29)
cmake version 3.16.3
Enter fullscreen mode Exit fullscreen mode
Collapse
 
gunjan_0307 profile image
gunjan agarwal

There has been some issue with the recent release of the Javy Toolchain as pointed by @deepanshu1484 i.e., There has been some changes in the way in order to make it work on Wasmtime and we do not require the use of msgpack-tools anymore and thus the process has even become more convenient now.
I have update this post, please have a look.
Thanks.

Collapse
 
developerworks profile image
developerworks
Thread Thread
 
gunjan_0307 profile image
gunjan agarwal

Yes I also followed his demo 😀