@@ -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
@@ -1219,6 +1221,7 @@ fn should_run_tool_build_step<'a>(
12191221 )
12201222}
12211223
1224+ #[ expect( clippy:: too_many_arguments) ] // silence overeager clippy lint
12221225fn run_tool_build_step (
12231226 builder : & Builder < ' _ > ,
12241227 compiler : Compiler ,
@@ -1227,6 +1230,7 @@ fn run_tool_build_step(
12271230 path : & ' static str ,
12281231 add_bins_to_sysroot : Option < & [ & str ] > ,
12291232 add_features : Option < fn ( & Builder < ' _ > , TargetSelection , & mut Vec < String > ) > ,
1233+ cargo_args : Option < & [ & ' static str ] > ,
12301234) -> ToolBuildResult {
12311235 let mut extra_features = Vec :: new ( ) ;
12321236 if let Some ( func) = add_features {
@@ -1243,7 +1247,7 @@ fn run_tool_build_step(
12431247 extra_features,
12441248 source_type : SourceType :: InTree ,
12451249 allow_features : "" ,
1246- cargo_args : vec ! [ ] ,
1250+ cargo_args : cargo_args . unwrap_or_default ( ) . iter ( ) . map ( |s| String :: from ( * s ) ) . collect ( ) ,
12471251 artifact_kind : ToolArtifactKind :: Binary ,
12481252 } ) ;
12491253
@@ -1294,7 +1298,9 @@ tool_extended!(Miri {
12941298 path: "src/tools/miri" ,
12951299 tool_name: "miri" ,
12961300 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" ] ,
12981304} ) ;
12991305tool_extended ! ( CargoMiri {
13001306 path: "src/tools/miri/cargo-miri" ,
0 commit comments