Stream: git-wasmtime

Topic: wasmtime / issue #3338 Fail to run AOT cwasm module which...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2021 at 15:23):

flyflypeng opened issue #3338:

Description

I want to run a simple AOT style cwasm module which is compiled by the wasmtime compile command. So I use the examples in the documentation: Creating hello-world.wasm

I compile the hello-world rust project to wasm32-wasi target and run it with wasmtime successfully:

root@node1: /home/xxx/wasm-by-example/hello-world# cargo build --target wasm32-wasi
   Compiling hello-world v0.1.0 (/home/xxx/wasm-by-example/hello-world)
    Finished dev [unoptimized + debuginfo] target(s) in 0.56s

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime run target/wasm32-wasi/debug/hello-world.wasm
Hello, world!

However, I failed to run the hello-world AOT format wasm module compiled by wasmtime compile command, the output is:

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime compile target/wasm32-wasi/debug/hello-world.wasm

root@node1:/home/xxx/wasm-by-example/hello-world# ls
Cargo.lock  Cargo.toml  hello-world.cwasm  src  target

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime run hello-world.cwasm
Error: failed to run main module `hello-world.cwasm`

Caused by:
    failed to parse `hello-world.cwasm`: input bytes aren't valid utf-8

Environment Info

wasmtime version:

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime --version
wasmtime 0.29.0

OS Info:

root@node1:/home/xxx/wasm-by-example/hello-world# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

root@node1:/home/xxx/wasm-by-example/hello-world# uname -r
4.15.0-154-generic

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2021 at 20:30):

alexcrichton closed issue #3338:

Description

I want to run a simple AOT style cwasm module which is compiled by the wasmtime compile command. So I use the examples in the documentation: Creating hello-world.wasm

I compile the hello-world rust project to wasm32-wasi target and run it with wasmtime successfully:

root@node1: /home/xxx/wasm-by-example/hello-world# cargo build --target wasm32-wasi
   Compiling hello-world v0.1.0 (/home/xxx/wasm-by-example/hello-world)
    Finished dev [unoptimized + debuginfo] target(s) in 0.56s

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime run target/wasm32-wasi/debug/hello-world.wasm
Hello, world!

However, I failed to run the hello-world AOT format wasm module compiled by wasmtime compile command, the output is:

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime compile target/wasm32-wasi/debug/hello-world.wasm

root@node1:/home/xxx/wasm-by-example/hello-world# ls
Cargo.lock  Cargo.toml  hello-world.cwasm  src  target

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime run hello-world.cwasm
Error: failed to run main module `hello-world.cwasm`

Caused by:
    failed to parse `hello-world.cwasm`: input bytes aren't valid utf-8

Environment Info

wasmtime version:

root@node1:/home/xxx/wasm-by-example/hello-world# wasmtime --version
wasmtime 0.29.0

OS Info:

root@node1:/home/xxx/wasm-by-example/hello-world# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

root@node1:/home/xxx/wasm-by-example/hello-world# uname -r
4.15.0-154-generic

Last updated: Dec 23 2024 at 13:07 UTC