Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,7 @@ macro_rules! tool_extended {
stable: $stable:expr
$( , add_bins_to_sysroot: $add_bins_to_sysroot:expr )?
$( , add_features: $add_features:expr )?
$( , cargo_args: $cargo_args:expr )?
$( , )?
}
) => {
Expand Down Expand Up @@ -1180,6 +1181,7 @@ macro_rules! tool_extended {
$path,
None $( .or(Some(&$add_bins_to_sysroot)) )?,
None $( .or(Some($add_features)) )?,
None $( .or(Some($cargo_args)) )?,
)
}

Expand Down Expand Up @@ -1219,6 +1221,7 @@ fn should_run_tool_build_step<'a>(
)
}

#[expect(clippy::too_many_arguments)] // silence overeager clippy lint
fn run_tool_build_step(
builder: &Builder<'_>,
compiler: Compiler,
Expand All @@ -1227,6 +1230,7 @@ fn run_tool_build_step(
path: &'static str,
add_bins_to_sysroot: Option<&[&str]>,
add_features: Option<fn(&Builder<'_>, TargetSelection, &mut Vec<String>)>,
cargo_args: Option<&[&'static str]>,
) -> ToolBuildResult {
let mut extra_features = Vec::new();
if let Some(func) = add_features {
Expand All @@ -1243,7 +1247,7 @@ fn run_tool_build_step(
extra_features,
source_type: SourceType::InTree,
allow_features: "",
cargo_args: vec![],
cargo_args: cargo_args.unwrap_or_default().iter().map(|s| String::from(*s)).collect(),
artifact_kind: ToolArtifactKind::Binary,
});

Expand Down Expand Up @@ -1294,7 +1298,9 @@ tool_extended!(Miri {
path: "src/tools/miri",
tool_name: "miri",
stable: false,
add_bins_to_sysroot: ["miri"]
add_bins_to_sysroot: ["miri"],
// Avoid costly rebuilds by always including the tests.
cargo_args: &["--all-targets"],
});
tool_extended!(CargoMiri {
path: "src/tools/miri/cargo-miri",
Expand Down
Loading