Building
This section describes everything required to build and run Wasmtime.
Prerequisites
Before we can actually build Wasmtime, we'll need to make sure these things areinstalled first.
Git Submodules
The Wasmtime repository contains a number of git submodules. To build Wasmtimeand most other crates in the repository, you have to ensure that those areinitialized with this command:
git submodule update --initThe Rust Toolchain
Install the Rust toolchain here. Thisincludesrustup,cargo,rustc, etc...
libclang (optional)
Thewasmtime-fuzzing crate transitively depends onbindgen, which requiresthat your system has alibclang installed. Therefore, if you want to hack onWasmtime's fuzzing infrastructure, you'll needlibclang.Details on how togetlibclang and make it available forbindgen arehere.
Building thewasmtime CLI
To make an unoptimized, debug build of thewasmtime CLI tool, go to the rootof the repository and run this command:
cargo buildThe built executable will be located attarget/debug/wasmtime.
To make an optimized build, run this command in the root of the repository:
cargo build --releaseThe built executable will be located attarget/release/wasmtime.
You can also build and run a localwasmtime CLI by replacingcargo buildwithcargo run.
Building the Wasmtime C API
Seecrates/c-api/README.mdfor details.
Building Other Wasmtime Crates
You can build any of the Wasmtime crates by appending-p wasmtime-whatever tothecargo build invocation. For example, to build thewasmtime-environ crate,execute this command:
cargo build -p wasmtime-environAlternatively, you cancd into the crate's directory, and runcargo buildthere, without needing to supply the-p flag:
cd crates/environ/cargo build