Commit 11c47d0
authored
fix(test): skip dwp uplift test without packed debuginfo (#17127)
### 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:
```console
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"
```2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
150 | 169 | | |
151 | 170 | | |
152 | 171 | | |
| |||
321 | 340 | | |
322 | 341 | | |
323 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
324 | 370 | | |
325 | 371 | | |
326 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5241 | 5241 | | |
5242 | 5242 | | |
5243 | 5243 | | |
5244 | | - | |
| 5244 | + | |
5245 | 5245 | | |
5246 | 5246 | | |
5247 | 5247 | | |
| |||
0 commit comments