Crate openvm_build

Crate openvm_build 

Source
Expand description

Build OpenVM guest code in Rust into RISC-V ELF with custom instructions.

Structs§

GuestOptions
Options defining how to embed a guest package.
TargetFilter
A filter for selecting a target from a package.

Constants§

DEFAULT_RUSTUP_TOOLCHAIN_NAME
The default Rust toolchain name to use if OPENVM_RUST_TOOLCHAIN is not set
RUSTC_TARGET
The rustc compiler target.

Functions§

build_generic
Generic wrapper call to cargo build
build_guest_package
Builds a package that targets the riscv guest into the specified target directory.
cargo_command
Creates a std::process::Command to execute the given cargo command in an environment suitable for targeting the zkvm guest.
current_package
When called from a build.rs, returns the current package being built.
detect_toolchain
Detect rust toolchain of given name
find_unique_executable
Finds the unique executable target in the given package and target directory, using the given target filter.
get_dir_with_profile
Returns the target executable directory given target_dir and profile.
get_in_scope_packages
Returns a single package if the manifest path matches exactly, otherwise returns all workspace packages.
get_package
Returns the given cargo Package from the metadata in the Cargo.toml manifest within the provided manifest_dir.
get_rustup_toolchain_name
Get the Rust toolchain name from environment variable or default
get_target_dir
Determines and returns the build target directory from the Cargo manifest at the given manifest_path.
get_workspace_packages
Returns all packages from the Cargo.toml manifest at the given manifest_dir.
get_workspace_root
Returns the workspace root directory from the Cargo manifest at the given manifest_path.
guest_methods
Returns all target ELF paths associated with the given guest crate.
is_skip_build
Reads the value of the environment variable OPENVM_SKIP_BUILD and returns true if it is set to 1.