9 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -1029,7 +1029,8 @@ def build_bootstrap_cmd(self, env):
1029
1029
raise Exception ("no cargo executable found at `{}`" .format (
1030
1030
self .cargo ()))
1031
1031
args = [self .cargo (), "build" , "--manifest-path" ,
1032
- os .path .join (self .rust_root , "src/bootstrap/Cargo.toml" )]
1032
+ os .path .join (self .rust_root , "src/bootstrap/Cargo.toml" ),
1033
+ "-Zroot-dir=" + self .rust_root ]
1033
1034
args .extend ("--verbose" for _ in range (self .verbose ))
1034
1035
if self .use_locked_deps :
1035
1036
args .append ("--locked" )
Original file line number Diff line number Diff line change @@ -305,9 +305,10 @@ impl Step for Cargo {
305
305
// those features won't be able to land.
306
306
cargo. env ( "CARGO_TEST_DISABLE_NIGHTLY" , "1" ) ;
307
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 ) ) ;
308
+ // Cargo's test suite uses `CARGO_RUSTC_CURRENT_DIR` to determine the path that `file!` is
309
+ // relative to. Cargo no longer sets this env var, so we have to do that. This has to be the
310
+ // same value as `-Zroot-dir`.
311
+ cargo. env ( "CARGO_RUSTC_CURRENT_DIR" , builder. src . display ( ) . to_string ( ) ) ;
311
312
312
313
#[ cfg( feature = "build-metrics" ) ]
313
314
builder. metrics . begin_test_suite (
Original file line number Diff line number Diff line change @@ -703,6 +703,9 @@ impl Builder<'_> {
703
703
704
704
cargo. arg ( "-j" ) . arg ( self . jobs ( ) . to_string ( ) ) ;
705
705
706
+ // Make cargo emit diagnostics relative to the rustc src dir.
707
+ cargo. arg ( format ! ( "-Zroot-dir={}" , self . src. display( ) ) ) ;
708
+
706
709
// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
707
710
// Force cargo to output binaries with disambiguating hashes in the name
708
711
let mut metadata = if compiler. stage == 0 {
Original file line number Diff line number Diff line change 1
- thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
1
+ thread 'main' panicked at library/ core/src/panicking.rs:$LINE:$COL:
2
2
attempted to compute the size or alignment of extern type `Opaque`
3
3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4
4
thread caused non-unwinding panic. aborting.
Original file line number Diff line number Diff line change 1
- thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
1
+ thread 'main' panicked at library/ core/src/panicking.rs:$LINE:$COL:
2
2
attempted to compute the size or alignment of extern type `A`
3
3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4
4
thread caused non-unwinding panic. aborting.
Original file line number Diff line number Diff line change 1
- thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
1
+ thread 'main' panicked at library/ core/src/panicking.rs:$LINE:$COL:
2
2
attempted to compute the size or alignment of extern type `A`
3
3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4
4
thread caused non-unwinding panic. aborting.
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4
4
thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9:
5
5
BOOM
6
6
stack backtrace:
7
- thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
7
+ thread 'main' panicked at library/ core/src/panicking.rs:$LINE:$COL:
8
8
panic in a destructor during cleanup
9
9
thread caused non-unwinding panic. aborting.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ thread 'main' panicked at $DIR/panic-in-ffi.rs:21:5:
2
2
Test
3
3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4
4
Noisy Drop
5
- thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
5
+ thread 'main' panicked at library/ core/src/panicking.rs:$LINE:$COL:
6
6
panic in a function that cannot unwind
7
7
stack backtrace:
8
8
thread caused non-unwinding panic. aborting.
Original file line number Diff line number Diff line change 1
- thread 'main' panicked at std/src/io/stdio.rs:LL:CC:
1
+ thread 'main' panicked at library/ std/src/io/stdio.rs:LL:CC:
2
2
failed printing to stdout: Broken pipe (os error 32)
3
3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0 commit comments