Skip to content

Detect compatible `wasm-opt` versions and improve error messages

Created by: cmichi

The improved error message:

ERROR: wasm-opt not found!
We use this tool to optimize the size of your contract's Wasm binary.

wasm-opt is part of the binaryen package. You can find detailed
installation instructions on https://github.com/WebAssembly/binaryen#tools.

There are also ready-to-install packages for many platforms:
* Debian/Ubuntu: https://tracker.debian.org/pkg/binaryen
* Homebrew: https://formulae.brew.sh/formula/binaryen
* Arch Linux: https://archlinux.org/packages/community/x86_64/binaryen
* Windows: binary releases are available at https://github.com/WebAssembly/binaryen/releases

I'm aware that linking packages here can be seen as controversial, but due to the number of questions we get in public channels regarding this I think we should consider it.

Merge request reports