Common tooling
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 (opens in a new tab):
Install Rust
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shInstall the latest stable version of Rust
rustup install stable && rustup default stableAdd the WASI target
rustup target add wasm32-wasiInstall wasm-tools
cargo install --force --locked wasm-tools@1.0.57Confirm the installation:
wasm-tools --version
wasm-tools 1.0.57Install wit-bindgen
Only required for non-Rust Tier 1 Languages
Rust users can skip this step as wit-bindgen is encapsulated by cargo-component
cargo install wit-bindgen-cli --git https://github.com/bytecodealliance/wit-bindgen --force --rev 61229eff20fdbc2fe7dac12a269cf7cea24e39d0Confirm the installation:
wit-bindgen --version
wit-bindgen-cli 0.16.0 (61229eff2 2024-01-30)Install wasm-opt (optional)
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 golangThen use it to install wasm-opt:
go install github.com/gonowa/wasm-opt@latest