Use print instead of po in debuginfo path test#156769
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Reproduced on Apple LLDB 2100.
Submitted a PR replacing |
|
Reminder, once the PR becomes ready for a review, use |
|
Thanks, that makes sense. I investigated this further on my side as well. I checked an older revision (
The pretty printers still seem to work correctly through If this is indeed related to #147552, I'm happy to adjust the approach or update the PR accordingly. |
|
The actual root cause is simply that we do not test this version in CI. I believe we test LLDB 1703 now? See
@bors try jobs=aarch64-apple Making the test more tolerant by making it accept virtually anything with the same prefix, when it previously tested for two different output formats, one significantly more verbose than the test checks for, does seem to defeat the purpose of having a test here. |
This comment has been minimized.
This comment has been minimized.
Use print instead of po in debuginfo path test try-job: aarch64-apple
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Sorry, I did some more digging, and I now think that we should indeed remove the po cmd/checks based on dug up info. Can you undo the check relaxation for print?
@rustbot author
There was a problem hiding this comment.
Suggestion: okay, so I did some more digging with the help of @NobodyNada (thanks!!), and this is what I can gather (likely contains inaccuracies, happy to be corrected):
pois (typically) aliased toexpr --object-description, which lldb 21 says-O ( --object-description ) Display using a language-specific description API, if possible.- The problem is that AFAIK
expr(and thuspo) tries to "[e]valuate an expression on the current thread" plus--object-descriptionwill try to find a language-specific description API where possible- Rust doesn't really have this "language-specific description API" (objective C / swift have that upstream AFAICT)
- Fallback logic previously was sth like (1) try to find lang-specific description API, (2) fallback to
p(basicexpr) if not found (in our case printing the "data""/some/path"), silently. - @NobodyNada helped to bisect the difference to [lldb] Print ValueObject when GetObjectDescription fails llvm/llvm-project#152417 which AFAICT (IMO very correctly) changes the silent fallback to actually show a warning.
- The existing
//@ lldb-check:"/some/path"fails, because the warnings of course are extra bits, and it's not just a naive "print the data" but instead falls back top pathorexpr path.
- Also, note that on more recent versions of lldb,
printis usually aliases todwim-print(Do What I Mean™️ print). - IOW, I think the original
pochecks happened to accidentally work as it relied on a specific silent fallback behavior, and I think we should just avoid trying to test that. Sure, users can and will try topo pathw/ an error message, but at least they still getp pathback.
Example failure (lldb 22):
po path
error: not a pointer type (&std::path::Path) "/some/path" { data_ptr = 0x0000000100000b58 length = 10 }
# what `p path` fallback looks like
p path
(&std::path::Path) "/some/path" { data_ptr = 0x0000000100000b58 length = 10 }
For our purposes, I do agree (now) that print (DWIM print) is good enough tbh, and it's probably the best we can do absent actual upstream object description API support (happy to be corrected on this front).
I however suggest only removing the po lines and their corresponding check, but don't relax the check on print {path,pathbuf}, i.e. only do
diff --git a/tests/debuginfo/path.rs b/tests/debuginfo/path.rs
index 27b518fd897..2fffadd8510 100644
--- a/tests/debuginfo/path.rs
+++ b/tests/debuginfo/path.rs
@@ -8,12 +8,8 @@
//@ lldb-command:print pathbuf
//@ lldb-check:[...] "/some/path" { inner = "/some/path" { inner = { inner = size=10 { [0] = '/' [1] = 's' [2] = 'o' [3] = 'm' [4] = 'e' [5] = '/' [6] = 'p' [7] = 'a' [8] = 't' [9] = 'h' } } } }
-//@ lldb-command:po pathbuf
-//@ lldb-check:"/some/path"
//@ lldb-command:print path
//@ lldb-check:[...] "/some/path" { data_ptr = [...] length = 10 }
-//@ lldb-command:po path
-//@ lldb-check:"/some/path"|
Updated. I restored the original |
|
@rustbot ready |
|
@bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
Use print instead of po in debuginfo path test try-job: aarch64-apple
|
⌛ Testing commit 6ed5bf2 with merge 30e8a87... Workflow: https://github.com/rust-lang/rust/actions/runs/26354003258 |
Use print instead of po in debuginfo path test Fixes #156660 This fixes `tests/debuginfo/path.rs` failing on newer Apple LLDB versions. Root cause: Apple LLDB 2100 reports missing Rust language plugin support: warning: `po` was unsuccessful, running `p` instead As a result, `po` falls back to `p`, producing expanded output that no longer matches the existing `lldb-check` directives. Changes: - replace `po` with `print` - relax `lldb-check` expectations using `[...]` - preserve validation of the displayed path value This also aligns `path.rs` with the rest of the debuginfo tests, as it appears to be the only test using `po`. --- EDIT(@jieyouxu): see digging #156769 (comment)
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #156870. |
…uwer Rollup of 6 pull requests Successful merges: - #156769 (Use print instead of po in debuginfo path test) - #156784 (Fix reborrow_info early return skipping field validation) - #156827 (float_literal_f32_fallback: Don't suggest invalid code) - #156828 (Add unstable Share trait) - #156830 (Add `#[doc(alias = "phi")]` for float `GOLDEN_RATIO` constants) - #156860 (Fix Pieter-Louis Schoeman mailmap entry)
View all comments
Fixes #156660
This fixes
tests/debuginfo/path.rsfailing on newer Apple LLDB versions.Root cause:
Apple LLDB 2100 reports missing Rust language plugin support:
warning:
powas unsuccessful, runningpinsteadAs a result,
pofalls back top, producing expanded output that no longer matches the existinglldb-checkdirectives.Changes:
powithprintlldb-checkexpectations using[...]This also aligns
path.rswith the rest of the debuginfo tests, as it appears to be the only test usingpo.EDIT(@jieyouxu): see digging #156769 (comment)