Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ pub use self::mode::InstallMode;
pub use self::os::Os;
pub use self::tool::Tool;

/// The version of wasm-opt that will be downloaded and used for optimizing the wasm output.
///
/// E.g. `version_122`
///
// Make sure to update the version in docs/src/cargo-toml-configuration.md as well
pub const WASM_OPT_VERSION: u32 = 117;

/// Possible outcomes of attempting to find/install a tool
pub enum Status {
/// Couldn't install tool because downloads are forbidden by user
Expand Down Expand Up @@ -201,9 +208,9 @@ pub fn prebuilt_url_for(tool: &Tool, version: &str, arch: &Arch, os: &Os) -> Res
))
},
Tool::WasmOpt => {
let version = format!("version_{}", WASM_OPT_VERSION);
Ok(format!(
"https://github.com/WebAssembly/binaryen/releases/download/{vers}/binaryen-{vers}-{target}.tar.gz",
vers = "version_117", // Make sure to update the version in docs/src/cargo-toml-configuration.md as well
"https://github.com/WebAssembly/binaryen/releases/download/{version}/binaryen-{version}-{target}.tar.gz",
target = target,
))
}
Expand Down
5 changes: 4 additions & 1 deletion src/wasm_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ pub fn run(cache: &Cache, out_dir: &Path, args: &[String], install_permitted: bo
None => return Ok(()),
};

PBAR.info("Optimizing wasm binaries with `wasm-opt`...");
PBAR.info(&format!(
"Optimizing wasm binaries with `wasm-opt@{version}`...",
version = install::WASM_OPT_VERSION
));

for file in out_dir.read_dir()? {
let file = file?;
Expand Down
Loading