The following tools are required or optionally usable for most the supported guest languages.
First of all, to install wasm-tools
via cargo
, you need to install the latest stable version of Rust. The recommended way to do so is using https://rustup.rs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install stable && rustup default stable
rustup target add wasm32-wasi
Then install the supported version of the wasm-tools
tool via cargo:
cargo install wasm-tools@1.0.40
wasm-tools --version
wasm-tools 1.0.40
For Tier 2 guest languages you also need wit-bindgen
(except for Rust where it is encapsulated by cargo-component
):
cargo install wit-bindgen-cli@0.11.0
wit-bindgen --version
wit-bindgen-cli 0.11.0
An optional tool for making the wasm
modules smaller (recommended for Swift) is wasm-opt
First you need to install the latest version of Go:
brew install golang
Then use it to install wasm-opt
:
go install github.com/gonowa/wasm-opt@latest