@@ -222,17 +222,18 @@ impl Step for Cargo {
222
222
compiler,
223
223
target : self . host ,
224
224
} ) ;
225
- let mut cargo = builder. cargo ( compiler, Mode :: ToolRustc , self . host , "test" ) ;
226
- cargo
227
- . arg ( "--manifest-path" )
228
- . arg ( builder. src . join ( "src/tools/cargo/Cargo.toml" ) ) ;
225
+ let mut cargo = tool:: prepare_tool_cargo ( builder,
226
+ compiler,
227
+ Mode :: ToolRustc ,
228
+ self . host ,
229
+ "test" ,
230
+ "src/tools/cargo" ,
231
+ true ) ;
232
+
229
233
if !builder. fail_fast {
230
234
cargo. arg ( "--no-fail-fast" ) ;
231
235
}
232
236
233
- // Don't build tests dynamically, just a pain to work with
234
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
235
-
236
237
// Don't run cross-compile tests, we may not have cross-compiled libstd libs
237
238
// available.
238
239
cargo. env ( "CFG_DISABLE_CROSS_TESTS" , "1" ) ;
@@ -289,9 +290,6 @@ impl Step for Rls {
289
290
"src/tools/rls" ,
290
291
true ) ;
291
292
292
- // Don't build tests dynamically, just a pain to work with
293
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
294
-
295
293
builder. add_rustc_lib_path ( compiler, & mut cargo) ;
296
294
297
295
if try_run ( builder, & mut cargo) {
@@ -345,8 +343,6 @@ impl Step for Rustfmt {
345
343
"src/tools/rustfmt" ,
346
344
true ) ;
347
345
348
- // Don't build tests dynamically, just a pain to work with
349
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
350
346
let dir = testdir ( builder, compiler. host ) ;
351
347
t ! ( fs:: create_dir_all( & dir) ) ;
352
348
cargo. env ( "RUSTFMT_TEST_DIR" , dir) ;
@@ -394,13 +390,14 @@ impl Step for Miri {
394
390
extra_features : Vec :: new ( ) ,
395
391
} ) ;
396
392
if let Some ( miri) = miri {
397
- let mut cargo = builder. cargo ( compiler, Mode :: ToolRustc , host, "test" ) ;
398
- cargo
399
- . arg ( "--manifest-path" )
400
- . arg ( builder. src . join ( "src/tools/miri/Cargo.toml" ) ) ;
393
+ let mut cargo = tool:: prepare_tool_cargo ( builder,
394
+ compiler,
395
+ Mode :: ToolRustc ,
396
+ host,
397
+ "test" ,
398
+ "src/tools/miri" ,
399
+ true ) ;
401
400
402
- // Don't build tests dynamically, just a pain to work with
403
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
404
401
// miri tests need to know about the stage sysroot
405
402
cargo. env ( "MIRI_SYSROOT" , builder. sysroot ( compiler) ) ;
406
403
cargo. env ( "RUSTC_TEST_SUITE" , builder. rustc ( compiler) ) ;
@@ -452,13 +449,14 @@ impl Step for Clippy {
452
449
extra_features : Vec :: new ( ) ,
453
450
} ) ;
454
451
if let Some ( clippy) = clippy {
455
- let mut cargo = builder. cargo ( compiler, Mode :: ToolRustc , host, "test" ) ;
456
- cargo
457
- . arg ( "--manifest-path" )
458
- . arg ( builder. src . join ( "src/tools/clippy/Cargo.toml" ) ) ;
452
+ let mut cargo = tool:: prepare_tool_cargo ( builder,
453
+ compiler,
454
+ Mode :: ToolRustc ,
455
+ host,
456
+ "test" ,
457
+ "src/tools/clippy" ,
458
+ true ) ;
459
459
460
- // Don't build tests dynamically, just a pain to work with
461
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
462
460
// clippy tests need to know about the stage sysroot
463
461
cargo. env ( "SYSROOT" , builder. sysroot ( compiler) ) ;
464
462
cargo. env ( "RUSTC_TEST_SUITE" , builder. rustc ( compiler) ) ;
0 commit comments