bytecodealliance/cargo-wasi

Improve handling of locating `wasm-opt`

alexcrichton opened this issue · 0 comments

Currently wasm-opt is run like so:

  • If WASM_OPT is set, run that
  • Otherwise, download a precompiled binary
  • If no precompiled binary exists, error

This fails to handle a pre-installed wasm-opt, and while it's perhaps a good balance for cargo install'd binaries this probably is the wrong balance for installation of this tool through other mechanisms. A build time config option should be added to enable usage of wasm-opt on PATH by default and/or disabling the download of precompiled binaries.

As brought up in #25 I think it's fine to pick any option as the default, since the main use case is the precompiled binaries on crates.io which we can always configure as we want on CI.