pub struct GuestBuild {
pub manifest_dir: PathBuf,
pub target_json_path: PathBuf,
pub target_dir_name: String,
pub build_kind: BuildKind,
pub extra_rustflags: Vec<String>,
pub env_overrides: Vec<(String, String)>,
pub rustc_bootstrap: bool,
}Expand description
Configuration for a guest (cross-compiled) cargo build.
Spawns a separate cargo build subprocess with its own CARGO_TARGET_DIR
to avoid deadlocking with the outer cargo process running build.rs.
Fields§
§manifest_dir: PathBufAbsolute path to the service crate directory (containing Cargo.toml).
target_json_path: PathBufAbsolute path to the target JSON file.
target_dir_name: StringName used as subdirectory in cargo’s target dir (e.g. “riscv64em-javm”).
This is the directory name cargo creates under target/ for the custom target.
build_kind: BuildKindWhether to build a binary or library.
extra_rustflags: Vec<String>Extra flags appended to CARGO_ENCODED_RUSTFLAGS.
env_overrides: Vec<(String, String)>Extra environment variables to set (e.g. CARGO_PROFILE_RELEASE_STRIP=false).
rustc_bootstrap: boolSet RUSTC_BOOTSTRAP=1 so stable rustc accepts -Z flags.
Implementations§
Source§impl GuestBuild
impl GuestBuild
Sourcepub fn build(&self) -> PathBuf
pub fn build(&self) -> PathBuf
Run the inner cargo build. Returns the absolute path to the output ELF.
Emits cargo:rerun-if-changed directives for the service source files
and cargo:rerun-if-env-changed for SKIP_GUEST_BUILD.
§Panics
Panics if the build fails or the output artifact is not found.