fix(test): skip dwp uplift test without packed debuginfo#17127
Conversation
|
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 (
Why was this reviewer chosen?The reviewer was selected based on:
|
67ecbf1 to
4dee5a2
Compare
| // 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
That really makes sense! And I will revise it.
Thanks for the review!
There was a problem hiding this comment.
And I'm wondering if current diff is proper. Wishing for further opinion!
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
4dee5a2 to
378d210
Compare
What does this PR try to resolve?
Fix: rust-lang/rust#158213.
uplift_dwp_of_bin_on_linuxassumes all Linux hosts can produce.dwpfiles by requesting-Csplit-debuginfo=packed. That is not true for every Linux target. For example,riscv64gc-unknown-linux-gnucurrently reports onlyofffromrustc --print=split-debuginfo.When Cargo sees that
packedis unsupported, it correctly avoids passing-Csplit-debuginfo=packed, so rustc does not emit.dwpfiles. The test then fails because it still unconditionally expects those files.This PR adds a
requires_host_split_debuginfo = "packed"option to thecargo_testmacro and uses it for the.dwpuplift 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: