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