Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.5 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.5 KB

Wasmtime Engine

The build.rs script in this directory will build a Sightglass-compatible1 benchmarking library using the Wasmtime engine. The script output is a shared library (e.g., libengine.so) that can be used for running benchmarks; the output also includes a build metadata file (i.e., .build-info) that contains environment information for reproducing the build. build.rs is a Rust script so that it can be used on any supported OS.

Use

To build the files and store them in the current working directory, run:

rustc build.rs
./build

The script can be configured in several ways:

[REPOSITORY=<repo url>] [REVISION=<hash|branch|tag>] ./build [<destination dir>]

All configuration is optional. The script responds to environment variables that change the Wasmtime source code used; by default, the script will download the tip-of-main Wasmtime from the official repository. Note that a hash, if provided, must be the full commit hash. If provided, the first CLI argument can override the destination directory at which to place the built files.

Contributing

Since this script is not part of the main CI it would be helpful to run the following commands before upstreaming changes:

rustfmt build.rs
clippy-driver build.rs

Footnotes

  1. The specific details of the bench API that must be exported by the engine shared library are available in the Wasmtime bench-api documentation.