Skip to content

fix(test): skip dwp uplift test without packed debuginfo#17127

Merged
ehuss merged 1 commit into
rust-lang:masterfrom
HNO3Miracle:fix-uplift-dwp-packed-support
Jun 22, 2026
Merged

fix(test): skip dwp uplift test without packed debuginfo#17127
ehuss merged 1 commit into
rust-lang:masterfrom
HNO3Miracle:fix-uplift-dwp-packed-support

Conversation

@HNO3Miracle

@HNO3Miracle HNO3Miracle commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

Fix: rust-lang/rust#158213.

uplift_dwp_of_bin_on_linux assumes all Linux hosts can produce .dwp files by requesting -Csplit-debuginfo=packed. That is not true for every Linux target. For example, riscv64gc-unknown-linux-gnu currently reports only off from rustc --print=split-debuginfo.

When Cargo sees that packed is unsupported, it correctly avoids passing -Csplit-debuginfo=packed, so rustc does not emit .dwp files. The test then fails because it still unconditionally expects those files.

This PR adds a requires_host_split_debuginfo = "packed" option to the cargo_test macro and uses it for the .dwp uplift test, so unsupported hosts show the test as ignored instead of silently returning.

How to test and review this PR?

The main behavior to review is that the test still runs on Linux hosts that support packed, while being marked ignored on Linux hosts like RISC-V where Cargo cannot request packed split debuginfo.

Tested with:

build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt --check src/tools/cargo/crates/cargo-test-macro/src/lib.rs src/tools/cargo/tests/testsuite/build.rs
RUST_BACKTRACE=1 ./x test --stage 2 src/tools/cargo --test-args "build::uplift_dwp_of_bin_on_linux --exact --nocapture"

@rustbot rustbot added A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2026
@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @ehuss (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

@HNO3Miracle HNO3Miracle force-pushed the fix-uplift-dwp-packed-support branch from 67ecbf1 to 4dee5a2 Compare June 22, 2026 06:28
@HNO3Miracle HNO3Miracle changed the title Skip dwp uplift test without packed debuginfo fix(test): skip dwp uplift test without packed debuginfo Jun 22, 2026
Comment thread tests/testsuite/build.rs Outdated
// Some Linux targets, like RISC-V, don't support packed split debuginfo.
// Cargo won't request `packed` in that case, so rustc won't emit `.dwp` files.
if !cargo_test_support::rustc_supports_split_debuginfo("packed") {
return;

@ehuss ehuss Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests that silently don't do anything can be difficult to debug or notice if they aren't working correctly. Usually we try to add the ignore attribute when possible to make it visible. Would it be possible to instead add a requires_host_split_debuginfo = "packed" to the cargo_test macro? I think it shouldn't require too many extra lines of code. There are several examples there which call the set_ignore! macro, and I think the code you have in rustc_supports_split_debuginfo would essentially be the same, just moved over there.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That really makes sense! And I will revise it.

Thanks for the review!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I'm wondering if current diff is proper. Wishing for further opinion!

Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
@HNO3Miracle HNO3Miracle force-pushed the fix-uplift-dwp-packed-support branch from 4dee5a2 to 378d210 Compare June 22, 2026 15:56

@ehuss ehuss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

If the macro grows more over time, we might consider adding more helper functions to reduce some of the duplication, but I don't think it is necessarily urgent right now.

View changes since this review

@ehuss ehuss added this pull request to the merge queue Jun 22, 2026
Merged via the queue into rust-lang:master with commit 11c47d0 Jun 22, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testing-cargo-itself Area: cargo's tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

riscv64: cargo testsuite: uplift_dwp_of_bin_on_linux fails (foo.dwp missing)

3 participants