Rust bindings for Binaryen's wasm-opt
APACHE-2.0 License
wasm-opt
wasm-opt
is a component of the Binaryen toolkit
that optimizes WebAssembly modules. It is written
in C++.
This project provides a Rust crate that builds wasm-opt
and:
cargo install
,cargo install wasm-opt --locked
It should behave exactly the same as wasm-opt
installed from other sources.
See the API documentation.
git clone https://github.com/brson/wasm-opt-rs
cd wasm-opt-rs
git submodule update --init --recursive
cargo build && cargo test
Requires Rust 1.48+ and a C++ compiler with C++17 support. It does not require CMake or other C++ build tools.
These are the earliest C++ compiler versions known to work:
wasm-opt-sys
crate takes a non-negligible amount of time to build. Itwasm-opt
on Windows does not support extended unicode paths (probablycargo tarpaulin
(code coverage) segfaults running any wasm-opt
wasm-opt
. If you useBinaryen uses a single monotonically-increasing number for versions.
This crate uses the semver minor version to track the Binaryen version,
so e.g. the wasm-opt
crate version 0.110.0
corresponds to Binaryen 110.
Point releases are used for bugfixes.
Since minor version bumps of crates earlier than 1.0.0
are considered breaking,
users need to explicitly upgrade versions of wasm-opt
to get new Binaryen releases,
and upgrades may have breaking API changes,
though we don't anticipate significant changes.
This project was created thanks to a grant from the Web3 Foundation.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Binaryen itself, code from which is compiled and linked by this project, is licensed under the terms of the Apache License, Version 2.0.