pub struct BuildConfig {Show 20 fields
pub id: Option<String>,
pub binary: Option<String>,
pub skip: Option<StringOrBool>,
pub targets: Option<Vec<String>>,
pub features: Option<Vec<String>>,
pub no_default_features: Option<bool>,
pub env: Option<HashMap<String, HashMap<String, String>>>,
pub copy_from: Option<String>,
pub flags: Option<Vec<String>>,
pub reproducible: Option<bool>,
pub hooks: Option<BuildHooksConfig>,
pub ignore: Option<Vec<BuildIgnore>>,
pub overrides: Option<Vec<BuildOverride>>,
pub cross_tool: Option<String>,
pub mod_timestamp: Option<String>,
pub command: Option<String>,
pub no_unique_dist_dir: Option<StringOrBool>,
pub amd64_variant: Option<Amd64Variant>,
pub builder: Option<BuilderKind>,
pub prebuilt: Option<PrebuiltConfig>,
/* private fields */
}Fields§
§id: Option<String>Unique identifier for this build, used to reference it from archives and other configs.
binary: Option<String>Binary name to build (must match a Cargo binary target in the crate).
Optional so that defaults.builds (a path-mirrored template that
applies to every crate) can omit binary — the per-crate builds[]
entry supplies it. When the binary is absent at the per-crate level
it falls back to the crate’s name field.
skip: Option<StringOrBool>When true (or template evaluating to “true”), skip this build entirely.
targets: Option<Vec<String>>Target triples to build for. When set, REPLACES defaults.targets
for this build (override semantics — the per-build value wins
outright, no concat). When None, this build inherits
defaults.targets verbatim. Both cli::commands::helpers:: collect_build_targets and stage-build enforce this rule.
features: Option<Vec<String>>Cargo features to enable for this build.
no_default_features: Option<bool>When true, pass –no-default-features to cargo build.
env: Option<HashMap<String, HashMap<String, String>>>Per-target environment variables keyed as {target: {KEY: VALUE}}.
copy_from: Option<String>Copy the binary from another build ID instead of building it.
flags: Option<Vec<String>>Extra flags passed to cargo build, one per list entry (e.g., ["--release", "--locked"]).
Each entry is template-rendered then passed verbatim as a single argv
token — there is no sh -c step and no shell tokenization, so a
rendered value containing spaces stays one argv entry (it is NOT
re-split). Use one list entry per flag, including the flag and its
value as separate entries (["--target-dir", "/tmp/{{ Version }}"])
when the value itself may contain spaces.
reproducible: Option<bool>When true, enable reproducible builds by stripping timestamps.
hooks: Option<BuildHooksConfig>Per-build hooks executed before and after compilation.
ignore: Option<Vec<BuildIgnore>>Exclude specific os/arch combinations from this build’s target matrix.
Falls back to defaults.builds.ignore when not set.
overrides: Option<Vec<BuildOverride>>Per-target overrides for env, flags, and features for this build.
Falls back to defaults.builds.overrides when not set.
cross_tool: Option<String>Override the cross-compilation tool binary path (e.g., a custom cross wrapper).
When set, this binary is used instead of cargo/cross/zigbuild.
mod_timestamp: Option<String>Override the modification timestamp of built binaries for reproducible builds.
Template string (e.g. "{{ CommitTimestamp }}") or unix timestamp.
command: Option<String>Override the cargo subcommand (default: auto-detected “build” or “zigbuild”).
Enables e.g. cargo auditable build by setting command: "auditable build".
no_unique_dist_dir: Option<StringOrBool>When true (or template evaluating to “true”), place binaries in flat dist/ instead of dist/{target}/. Overrides the crate-level setting.
amd64_variant: Option<Amd64Variant>Declared x86-64 micro-architecture level for this build’s artifacts:
"v2", "v3", "v4", or the "v1" baseline. When set, it overrides
the level anodizer detects from the resolved build env — the
config-map and inherited process environment merged under cargo’s own
mutually-exclusive source order (CARGO_ENCODED_RUSTFLAGS, then
RUSTFLAGS, then CARGO_TARGET_<TRIPLE>_RUSTFLAGS, first present
wins) carrying -Ctarget-cpu=x86-64-v<N> —
for BOTH the artifact’s amd64_variant metadata — which names a
v2/v3-tuned group’s archives (…_amd64v3.tar.gz) — and the config-time
asset-name derivation feeding cargo-binstall pkg_url and the
curl | sh installer’s case table. Declare it when the tuning value is
only resolvable at build time (e.g. RUSTFLAGS: "{{ .Env.CI_FLAGS }}")
or when importing a tuned binary via builder: prebuilt. Ignored for
non-x86_64 targets.
Typed as Amd64Variant, so any value outside "v1".."v4" is
rejected when the config is parsed — on every axis the field can be
set from (crates[], workspaces[].crates[], and defaults.builds).
builder: Option<BuilderKind>Builder to use for this entry. cargo (the default when omitted)
runs cargo build. prebuilt skips compilation and imports a
binary the operator already produced via the prebuilt: block.
When builder: prebuilt, targets: MUST be set explicitly — no
defaults.targets fallback — and the prebuilt.path template is
rendered per target then stat()-ed before the import.
prebuilt: Option<PrebuiltConfig>Options for the prebuilt builder. Required when
builder: prebuilt; ignored (with a config-load warning) otherwise.
Trait Implementations§
Source§impl Clone for BuildConfig
impl Clone for BuildConfig
Source§fn clone(&self) -> BuildConfig
fn clone(&self) -> BuildConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildConfig
impl Debug for BuildConfig
Source§impl Default for BuildConfig
impl Default for BuildConfig
Source§fn default() -> BuildConfig
fn default() -> BuildConfig
Source§impl<'de> Deserialize<'de> for BuildConfigwhere
BuildConfig: Default,
impl<'de> Deserialize<'de> for BuildConfigwhere
BuildConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for BuildConfig
impl JsonSchema for BuildConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more