From efd176bd1222fb8a8786d3237094a490f1248b18 Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Thu, 14 Jul 2022 13:17:39 +0200 Subject: [PATCH] d-bootstrap-custom-debuginfo-path Forwarded: not-needed =================================================================== Gbp-Pq: Topic build Gbp-Pq: Name d-bootstrap-custom-debuginfo-path.patch --- src/bootstrap/src/lib.rs | 22 ++----------------- .../issue-73167-remap-std.rs | 2 +- tests/run-make/remap-path-prefix-std/rmake.rs | 2 +- tests/rustdoc-ui/ice-bug-report-url.rs | 2 +- tests/rustdoc-ui/track-diagnostics.rs | 1 + tests/ui/extern/extern-types-field-offset.rs | 1 + tests/ui/hygiene/panic-location.rs | 1 + tests/ui/mir/lint/storage-live.rs | 1 + tests/ui/mir/lint/storage-live.stderr | 4 ++-- tests/ui/panics/panic-in-cleanup.rs | 1 + tests/ui/panics/panic-in-cleanup.run.stderr | 4 ++-- tests/ui/panics/panic-in-ffi.rs | 1 + tests/ui/panics/panic-in-ffi.run.stderr | 2 +- tests/ui/process/println-with-broken-pipe.rs | 8 +++++-- .../multiple_definitions_attribute_merging.rs | 1 + ...tiple_definitions_attribute_merging.stderr | 8 +++---- .../ui/resolve/proc_macro_generated_packed.rs | 1 + .../proc_macro_generated_packed.stderr | 6 ++--- tests/ui/track-diagnostics/track.rs | 1 + tests/ui/track-diagnostics/track2.rs | 1 + tests/ui/track-diagnostics/track3.rs | 1 + tests/ui/track-diagnostics/track4.rs | 1 + tests/ui/track-diagnostics/track5.rs | 1 + tests/ui/track-diagnostics/track6.rs | 1 + 24 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 857c0539e7..8abe0e7e4e 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1223,27 +1223,9 @@ impl Build { match which { GitRepo::Rustc => { - let sha = self.rust_sha().unwrap_or(&self.version); - - match remap_scheme { - RemapScheme::Compiler => { - // For compiler sources, remap via `/rustc-dev/{sha}` to allow - // distinguishing between compiler sources vs library sources, since - // `rustc-dev` dist component places them under - // `$sysroot/lib/rustlib/rustc-src/rust` as opposed to `rust-src`'s - // `$sysroot/lib/rustlib/src/rust`. - // - // Keep this scheme in sync with `rustc_metadata::rmeta::decoder`'s - // `try_to_translate_virtual_to_real`. - Some(format!("/rustc-dev/{sha}")) - } - RemapScheme::NonCompiler => { - // For non-compiler sources, use `/rustc/{sha}` remapping scheme. - Some(format!("/rustc/{sha}")) - } - } + Some(format!("/usr/src/rustc-{}", &self.version)) } - GitRepo::Llvm => Some(String::from("/rustc/llvm")), + GitRepo::Llvm => panic!("GitRepo::Llvm unsupported on Debian"), } } diff --git a/tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs b/tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs index eb610168dd..9119c1d92e 100644 --- a/tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs +++ b/tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs @@ -7,7 +7,7 @@ // true automatically. If paths to std library hasn't been remapped, we use the // above simulate-remapped-rust-src-base option to do it temporarily -// CHECK: !DIFile(filename: "{{/rustc/.*/library/std/src/panic.rs}}" +// CHECK: !DIFile(filename: "{{/usr/src/rustc-.*/library/std/src/panic.rs}}" fn main() { std::thread::spawn(|| { println!("hello"); diff --git a/tests/run-make/remap-path-prefix-std/rmake.rs b/tests/run-make/remap-path-prefix-std/rmake.rs index f5179038a9..788ebceeb9 100644 --- a/tests/run-make/remap-path-prefix-std/rmake.rs +++ b/tests/run-make/remap-path-prefix-std/rmake.rs @@ -48,6 +48,6 @@ fn main() { llvm_dwarfdump() .input("libstd.rlib") .run() - .assert_stdout_contains("/rustc/") + .assert_stdout_contains_regex("/usr/src/rustc-[^/]+/") .assert_stdout_not_contains(source_root().to_string_lossy()); } diff --git a/tests/rustdoc-ui/ice-bug-report-url.rs b/tests/rustdoc-ui/ice-bug-report-url.rs index 2e384fa1be..f31ea3fc4c 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.rs +++ b/tests/rustdoc-ui/ice-bug-report-url.rs @@ -4,7 +4,7 @@ //@ normalize-stderr: "note: compiler flags.*\n\n" -> "" //@ normalize-stderr: "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}" -//@ normalize-stderr: "thread.*panicked at compiler.*" -> "" +//@ normalize-stderr: "thread.*panicked at /.*compiler.*" -> "" //@ normalize-stderr: " +\d{1,}: .*\n" -> "" //@ normalize-stderr: " + at .*\n" -> "" //@ normalize-stderr: ".*note: Some details are omitted.*\n" -> "" diff --git a/tests/rustdoc-ui/track-diagnostics.rs b/tests/rustdoc-ui/track-diagnostics.rs index f8e710659a..ae909051fe 100644 --- a/tests/rustdoc-ui/track-diagnostics.rs +++ b/tests/rustdoc-ui/track-diagnostics.rs @@ -3,6 +3,7 @@ // Normalize the emitted location so this doesn't need // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" +//@ normalize-stderr: "/usr/src/rustc-[^/]+/" -> "" struct A; struct B; diff --git a/tests/ui/extern/extern-types-field-offset.rs b/tests/ui/extern/extern-types-field-offset.rs index 9fe1cdf3bc..e19815e767 100644 --- a/tests/ui/extern/extern-types-field-offset.rs +++ b/tests/ui/extern/extern-types-field-offset.rs @@ -3,6 +3,7 @@ //@ exec-env:RUST_BACKTRACE=0 //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ ignore-backends: gcc #![feature(extern_types)] diff --git a/tests/ui/hygiene/panic-location.rs b/tests/ui/hygiene/panic-location.rs index 27850f3e4c..8bbbc936ce 100644 --- a/tests/ui/hygiene/panic-location.rs +++ b/tests/ui/hygiene/panic-location.rs @@ -3,6 +3,7 @@ //@ exec-env:RUST_BACKTRACE=0 //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" // // Regression test for issue #70963 // The reported panic location should not be `<::core::macros::panic macros>`. diff --git a/tests/ui/mir/lint/storage-live.rs b/tests/ui/mir/lint/storage-live.rs index 047ceaaf82..d1f742a792 100644 --- a/tests/ui/mir/lint/storage-live.rs +++ b/tests/ui/mir/lint/storage-live.rs @@ -5,6 +5,7 @@ //@ normalize-stderr: "storage_live\[....\]" -> "storage_live[HASH]" //@ normalize-stderr: "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - " //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ rustc-env:RUST_BACKTRACE=0 #![feature(custom_mir, core_intrinsics)] diff --git a/tests/ui/mir/lint/storage-live.stderr b/tests/ui/mir/lint/storage-live.stderr index ef0d253b15..651b8e2327 100644 --- a/tests/ui/mir/lint/storage-live.stderr +++ b/tests/ui/mir/lint/storage-live.stderr @@ -1,12 +1,12 @@ error: internal compiler error: broken MIR in Item(DefId(0:8 ~ storage_live[HASH]::multiple_storage)) (after pass CheckForceInline) at bb0[1]: StorageLive(_1) which already has storage here - --> $DIR/storage-live.rs:22:13 + --> $DIR/storage-live.rs:23:13 | LL | StorageLive(a); | ^^^^^^^^^^^^^^ | note: delayed at compiler/rustc_mir_transform/src/lint.rs:LL:CC - disabled backtrace - --> $DIR/storage-live.rs:22:13 + --> $DIR/storage-live.rs:23:13 | LL | StorageLive(a); | ^^^^^^^^^^^^^^ diff --git a/tests/ui/panics/panic-in-cleanup.rs b/tests/ui/panics/panic-in-cleanup.rs index 23430d1f49..6ecec068d2 100644 --- a/tests/ui/panics/panic-in-cleanup.rs +++ b/tests/ui/panics/panic-in-cleanup.rs @@ -6,6 +6,7 @@ //@ normalize-stderr: "\n +at [^\n]+" -> "" //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ needs-unwind //@ ignore-emscripten "RuntimeError" junk in output //@ ignore-msvc SEH doesn't do panic-during-cleanup the same way as everyone else diff --git a/tests/ui/panics/panic-in-cleanup.run.stderr b/tests/ui/panics/panic-in-cleanup.run.stderr index b6b396d861..b0cd28c382 100644 --- a/tests/ui/panics/panic-in-cleanup.run.stderr +++ b/tests/ui/panics/panic-in-cleanup.run.stderr @@ -1,9 +1,9 @@ -thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:23:5: +thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:24:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:17:9: +thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:18:9: BOOM stack backtrace: diff --git a/tests/ui/panics/panic-in-ffi.rs b/tests/ui/panics/panic-in-ffi.rs index ef40a3b6f7..0f008fdeb0 100644 --- a/tests/ui/panics/panic-in-ffi.rs +++ b/tests/ui/panics/panic-in-ffi.rs @@ -7,6 +7,7 @@ //@ normalize-stderr: "\n +at [^\n]+" -> "" //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ needs-unwind //@ ignore-emscripten "RuntimeError" junk in output diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr index 49eb92ef7c..7c493d256e 100644 --- a/tests/ui/panics/panic-in-ffi.run.stderr +++ b/tests/ui/panics/panic-in-ffi.run.stderr @@ -1,5 +1,5 @@ -thread 'main' ($TID) panicked at $DIR/panic-in-ffi.rs:22:5: +thread 'main' ($TID) panicked at $DIR/panic-in-ffi.rs:23:5: Test note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Noisy Drop diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs index 51521f1dcf..01a3afa019 100644 --- a/tests/ui/process/println-with-broken-pipe.rs +++ b/tests/ui/process/println-with-broken-pipe.rs @@ -12,6 +12,7 @@ //@ ignore-backends: gcc //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ compile-flags: -Zon-broken-pipe=error // Test what the error message looks like when `println!()` panics because of @@ -41,8 +42,11 @@ fn main() { .stdout(Stdio::piped()) .spawn() .unwrap(); - let mut consumer = - Command::new("head").arg("-n1").stdin(producer.stdout.take().unwrap()).spawn().unwrap(); + let mut consumer = Command::new("head") + .arg("-n1") + .stdin(producer.stdout.take().unwrap()) + .spawn() + .unwrap(); consumer.wait().unwrap(); producer.wait().unwrap(); } diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.rs b/tests/ui/resolve/multiple_definitions_attribute_merging.rs index 9f1bff51a3..6a60b8c97c 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.rs +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.rs @@ -8,6 +8,7 @@ //@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> "" //@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ rustc-env:RUST_BACKTRACE=0 #[repr(packed)] diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr index b8b33e3417..8eb7ea5949 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr @@ -1,5 +1,5 @@ error[E0428]: the name `Dealigned` is defined multiple times - --> $DIR/multiple_definitions_attribute_merging.rs:18:1 + --> $DIR/multiple_definitions_attribute_merging.rs:19:1 | LL | struct Dealigned(u8, T); | --------------------------- previous definition of the type `Dealigned` here @@ -8,7 +8,7 @@ LL | struct Dealigned(u8, T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Dealigned` redefined here | = error: internal compiler error: compiler/rustc_mir_transform/src/check_packed_ref.rs:LL:CC: builtin derive created an unaligned reference - --> $DIR/multiple_definitions_attribute_merging.rs:18:25 + --> $DIR/multiple_definitions_attribute_merging.rs:19:25 | LL | #[derive(PartialEq)] | --------- in this derive macro expansion @@ -19,8 +19,8 @@ LL | struct Dealigned(u8, T); Box query stack during panic: -#0 [mir_built] building MIR for `::eq` -#1 [check_unsafety] unsafety-checking `::eq` +#0 [mir_built] building MIR for `::eq` +#1 [check_unsafety] unsafety-checking `::eq` ... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/proc_macro_generated_packed.rs b/tests/ui/resolve/proc_macro_generated_packed.rs index a8175895af..c777ed86a2 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.rs +++ b/tests/ui/resolve/proc_macro_generated_packed.rs @@ -8,6 +8,7 @@ //@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> "" //@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" //@ rustc-env:RUST_BACKTRACE=0 extern crate proc_macro_generate_packed; diff --git a/tests/ui/resolve/proc_macro_generated_packed.stderr b/tests/ui/resolve/proc_macro_generated_packed.stderr index d8e160d0c6..4275261279 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.stderr +++ b/tests/ui/resolve/proc_macro_generated_packed.stderr @@ -1,5 +1,5 @@ error: internal compiler error: compiler/rustc_mir_transform/src/check_packed_ref.rs:LL:CC: builtin derive created an unaligned reference - --> $DIR/proc_macro_generated_packed.rs:19:25 + --> $DIR/proc_macro_generated_packed.rs:20:25 | LL | #[derive(PartialEq)] | --------- in this derive macro expansion @@ -10,8 +10,8 @@ LL | struct Dealigned(u8, T); Box query stack during panic: -#0 [mir_built] building MIR for `::eq` -#1 [check_unsafety] unsafety-checking `::eq` +#0 [mir_built] building MIR for `::eq` +#1 [check_unsafety] unsafety-checking `::eq` ... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack error: aborting due to 1 previous error diff --git a/tests/ui/track-diagnostics/track.rs b/tests/ui/track-diagnostics/track.rs index 09864a6e30..08c3dac249 100644 --- a/tests/ui/track-diagnostics/track.rs +++ b/tests/ui/track-diagnostics/track.rs @@ -8,6 +8,7 @@ //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" // The test becomes too flaky if we care about exact args. If `-Z ui-testing` // from compiletest and `-Z track-diagnostics` from `// compile-flags` at the diff --git a/tests/ui/track-diagnostics/track2.rs b/tests/ui/track-diagnostics/track2.rs index 145b2a3e5d..593624f971 100644 --- a/tests/ui/track-diagnostics/track2.rs +++ b/tests/ui/track-diagnostics/track2.rs @@ -5,6 +5,7 @@ // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" fn main() { let _moved @ _from = String::from("foo"); diff --git a/tests/ui/track-diagnostics/track3.rs b/tests/ui/track-diagnostics/track3.rs index 144f2794e9..f05f443f17 100644 --- a/tests/ui/track-diagnostics/track3.rs +++ b/tests/ui/track-diagnostics/track3.rs @@ -5,6 +5,7 @@ // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" fn main() { let _unimported = Blah { field: u8 }; diff --git a/tests/ui/track-diagnostics/track4.rs b/tests/ui/track-diagnostics/track4.rs index 2ab7d54233..c9389f13e5 100644 --- a/tests/ui/track-diagnostics/track4.rs +++ b/tests/ui/track-diagnostics/track4.rs @@ -5,6 +5,7 @@ // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" pub onion { //~^ ERROR missing `enum` for enum definition diff --git a/tests/ui/track-diagnostics/track5.rs b/tests/ui/track-diagnostics/track5.rs index 4d47f56e58..a96520ae3e 100644 --- a/tests/ui/track-diagnostics/track5.rs +++ b/tests/ui/track-diagnostics/track5.rs @@ -5,6 +5,7 @@ // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" } //~^ ERROR unexpected closing delimiter: `}` diff --git a/tests/ui/track-diagnostics/track6.rs b/tests/ui/track-diagnostics/track6.rs index aa75c5691e..8b9e9cb165 100644 --- a/tests/ui/track-diagnostics/track6.rs +++ b/tests/ui/track-diagnostics/track6.rs @@ -5,6 +5,7 @@ // updating everytime someone adds or removes a line. //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" +//@ normalize-stderr: "/usr/src/rustc-(?:[^/]*)?/" -> "" pub trait Foo { fn bar(); -- 2.30.2