no prebuilt wasm-opt binaries

1.7k views Asked by At

I'm trying to build some webassembly rust applications on my raspberry pi (3b). Everything is going well, although I'm getting an error when running wasm-pack

~/rust/wasm-game-of-life $ wasm-pack build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.50s
[INFO]: Installing wasm-bindgen...
Error: no prebuilt wasm-opt binaries are available for this platform: Unrecognized target!
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.

It seems no wasm-opt binaries are found for my (armv71) platform. But it seems easy enough to clone them from here and build them myself.

But my question is how to add them to webassembly, so that they are found?

edit: to be clear, the build completes 'successfully', i.e. I can run the package. However, I want to use the size or speed optimizations of wasm-opt

1

There are 1 answers

0
JHBonarius On BEST ANSWER

I'm afaid there's no solution for this yet, as it's simply not implemented in the code (but it seems to be on the TODO list: there's comments in the code, but no actual matching implementation).

I've opened an issue on the github, which is still open. If you have the same issue, please report it in that issue, so it will get more priority.

There's a fix suggested by this issue report(specifically this commit) but it yet needs to be reviewed, tested and merged

update the PR has been merged, so it should be fixed now. I don't know as I don't have time for Rust at this point in my life