Hello, I'm looking at Rust's ability to target WebAssembly. I tried the tutorial here for a "Hello World":
It makes a large .wasm file, but then in the wasm-gc step I get an error:
$ wasm-gc target/wasm32-unknown-unknown/release/hello.wasm
thread 'main' panicked at 'failed to parse wasm module: Error(HeapOther("I/O Error: UnexpectedEof"))', /home/ae1020/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-gc-0.1.6/src/main.rs:45:36
note: run with
RUST_BACKTRACE=1environment variable to display a backtrace
Aborted (core dumped)
(Running with RUST_BACKTRACE=1 didn't offer much of a smoking gun beyond 'it was an error'.)
Previously when I'd tried building a more ambitious paint example found on GitHub, I also got a similar-looking error ("Unexpected EOF (at offset 2076395)")
Do these cases work for other people, and it's just something about my installation? Or has something changed?
I installed Rust via the
curl https://sh.rustup.rs -sSf | sh method on an Ubuntu 20.04.1 virtual machine. It reports rustc as version 1.46.0.