File tree 1 file changed +9
-2
lines changed
src/bootstrap/src/core/build_steps
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -261,12 +261,16 @@ pub struct Cargo {
261
261
host : TargetSelection ,
262
262
}
263
263
264
+ impl Cargo {
265
+ const CRATE_PATH : & str = "src/tools/cargo" ;
266
+ }
267
+
264
268
impl Step for Cargo {
265
269
type Output = ( ) ;
266
270
const ONLY_HOSTS : bool = true ;
267
271
268
272
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
269
- run. path ( "src/tools/cargo" )
273
+ run. path ( Self :: CRATE_PATH )
270
274
}
271
275
272
276
fn make_run ( run : RunConfig < ' _ > ) {
@@ -284,7 +288,7 @@ impl Step for Cargo {
284
288
Mode :: ToolRustc ,
285
289
self . host ,
286
290
Kind :: Test ,
287
- "src/tools/cargo" ,
291
+ Self :: CRATE_PATH ,
288
292
SourceType :: Submodule ,
289
293
& [ ] ,
290
294
) ;
@@ -299,6 +303,9 @@ impl Step for Cargo {
299
303
// those features won't be able to land.
300
304
cargo. env ( "CARGO_TEST_DISABLE_NIGHTLY" , "1" ) ;
301
305
cargo. env ( "PATH" , path_for_cargo ( builder, compiler) ) ;
306
+ // Cargo's test suite requires configurations from its own `.cargo/config.toml`.
307
+ // Change to the directory so Cargo can read from it.
308
+ cargo. current_dir ( builder. src . join ( Self :: CRATE_PATH ) ) ;
302
309
303
310
#[ cfg( feature = "build-metrics" ) ]
304
311
builder. metrics . begin_test_suite (
You can’t perform that action at this time.
0 commit comments