Skip to content

Commit 8ad4dd3

Browse files
committed
bootstrap/miri: avoid rebuilds for test builds
1 parent 558d253 commit 8ad4dd3

File tree

1 file changed

+7
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+7
-2
lines changed

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,7 @@ macro_rules! tool_extended {
11401140
stable: $stable:expr
11411141
$( , add_bins_to_sysroot: $add_bins_to_sysroot:expr )?
11421142
$( , add_features: $add_features:expr )?
1143+
$( , cargo_args: $cargo_args:expr )?
11431144
$( , )?
11441145
}
11451146
) => {
@@ -1180,6 +1181,7 @@ macro_rules! tool_extended {
11801181
$path,
11811182
None $( .or(Some(&$add_bins_to_sysroot)) )?,
11821183
None $( .or(Some($add_features)) )?,
1184+
None $( .or(Some($cargo_args)) )?,
11831185
)
11841186
}
11851187

@@ -1227,6 +1229,7 @@ fn run_tool_build_step(
12271229
path: &'static str,
12281230
add_bins_to_sysroot: Option<&[&str]>,
12291231
add_features: Option<fn(&Builder<'_>, TargetSelection, &mut Vec<String>)>,
1232+
cargo_args: Option<&[&'static str]>,
12301233
) -> ToolBuildResult {
12311234
let mut extra_features = Vec::new();
12321235
if let Some(func) = add_features {
@@ -1243,7 +1246,7 @@ fn run_tool_build_step(
12431246
extra_features,
12441247
source_type: SourceType::InTree,
12451248
allow_features: "",
1246-
cargo_args: vec![],
1249+
cargo_args: cargo_args.unwrap_or_default().iter().map(|s| String::from(*s)).collect(),
12471250
artifact_kind: ToolArtifactKind::Binary,
12481251
});
12491252

@@ -1294,7 +1297,9 @@ tool_extended!(Miri {
12941297
path: "src/tools/miri",
12951298
tool_name: "miri",
12961299
stable: false,
1297-
add_bins_to_sysroot: ["miri"]
1300+
add_bins_to_sysroot: ["miri"],
1301+
// Avoid costly rebuilds by always including the tests.
1302+
cargo_args: &["--all-targets"],
12981303
});
12991304
tool_extended!(CargoMiri {
13001305
path: "src/tools/miri/cargo-miri",

0 commit comments

Comments
 (0)