@@ -1140,6 +1140,7 @@ macro_rules! tool_extended {
1140
1140
stable: $stable: expr
1141
1141
$( , add_bins_to_sysroot: $add_bins_to_sysroot: expr ) ?
1142
1142
$( , add_features: $add_features: expr ) ?
1143
+ $( , cargo_args: $cargo_args: expr ) ?
1143
1144
$( , ) ?
1144
1145
}
1145
1146
) => {
@@ -1180,6 +1181,7 @@ macro_rules! tool_extended {
1180
1181
$path,
1181
1182
None $( . or( Some ( & $add_bins_to_sysroot) ) ) ?,
1182
1183
None $( . or( Some ( $add_features) ) ) ?,
1184
+ None $( . or( Some ( $cargo_args) ) ) ?,
1183
1185
)
1184
1186
}
1185
1187
@@ -1219,6 +1221,7 @@ fn should_run_tool_build_step<'a>(
1219
1221
)
1220
1222
}
1221
1223
1224
+ #[ expect( clippy:: too_many_arguments) ] // silence overeager clippy lint
1222
1225
fn run_tool_build_step (
1223
1226
builder : & Builder < ' _ > ,
1224
1227
compiler : Compiler ,
@@ -1227,6 +1230,7 @@ fn run_tool_build_step(
1227
1230
path : & ' static str ,
1228
1231
add_bins_to_sysroot : Option < & [ & str ] > ,
1229
1232
add_features : Option < fn ( & Builder < ' _ > , TargetSelection , & mut Vec < String > ) > ,
1233
+ cargo_args : Option < & [ & ' static str ] > ,
1230
1234
) -> ToolBuildResult {
1231
1235
let mut extra_features = Vec :: new ( ) ;
1232
1236
if let Some ( func) = add_features {
@@ -1243,7 +1247,7 @@ fn run_tool_build_step(
1243
1247
extra_features,
1244
1248
source_type : SourceType :: InTree ,
1245
1249
allow_features : "" ,
1246
- cargo_args : vec ! [ ] ,
1250
+ cargo_args : cargo_args . unwrap_or_default ( ) . iter ( ) . map ( |s| String :: from ( * s ) ) . collect ( ) ,
1247
1251
artifact_kind : ToolArtifactKind :: Binary ,
1248
1252
} ) ;
1249
1253
@@ -1294,7 +1298,9 @@ tool_extended!(Miri {
1294
1298
path: "src/tools/miri" ,
1295
1299
tool_name: "miri" ,
1296
1300
stable: false ,
1297
- add_bins_to_sysroot: [ "miri" ]
1301
+ add_bins_to_sysroot: [ "miri" ] ,
1302
+ // Avoid costly rebuilds by always including the tests.
1303
+ cargo_args: & [ "--all-targets" ] ,
1298
1304
} ) ;
1299
1305
tool_extended ! ( CargoMiri {
1300
1306
path: "src/tools/miri/cargo-miri" ,
0 commit comments