From a0a6043bd1947486764d3aeec40e1ee65b26e4db Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Wed, 16 Nov 2022 14:13:51 -0500 Subject: [PATCH 1/2] Register .dwp files as debuginfo artifacts so they get uplifted With this change linux split-debuginfo=packed builds will place the final .dwp in the top level target dir alongside the binary and report it as a file in the json messages. This puts it on equal footing with .pdb and .dysm files. --- src/cargo/core/compiler/build_context/target_info.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index a8561278e58..8d0d462a731 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -462,6 +462,16 @@ impl TargetInfo { // preserved. should_replace_hyphens: true, }) + } else { + ret.push(FileType { + suffix: ".dwp".to_string(), + prefix: prefix.clone(), + flavor: FileFlavor::DebugInfo, + crate_type: Some(crate_type), + // Currently no known reason to prefer one naming scheme + // over the other, but the macos approach seems friendlier. + should_replace_hyphens: false, + }) } } From 9d399e2cdc9f66c445724164cbdb295490d28522 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Fri, 18 Nov 2022 21:39:34 -0500 Subject: [PATCH 2/2] disable conflicting test on all of windows --- tests/testsuite/build.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 33fc7d30395..3ead8fb4778 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -4788,9 +4788,14 @@ fn cdylib_final_outputs() { } #[cargo_test] -// NOTE: Windows MSVC and wasm32-unknown-emscripten do not use metadata. Skip them. +// NOTE: Windows MSVC and wasm32-unknown-emscripten do not use metadata. // See -#[cfg(not(all(target_os = "windows", target_env = "msvc")))] +// +// We skip both msvc windows and gnu windows (mingw) because their naming schemes for +// debuginfo files results in conflicts in this case. msvc makes two `foo.pdb` files +// while mingw makes two `foo.dwp` files. These files clobber eachother, +// corrupting the build output. +#[cfg(not(target_os = "windows"))] fn no_dep_info_collision_when_cdylib_and_bin_coexist() { let p = project() .file(