Skip to content

Use print instead of po in debuginfo path test#156769

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fallofpheonix:fix-path-lldb-macos
May 24, 2026
Merged

Use print instead of po in debuginfo path test#156769
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fallofpheonix:fix-path-lldb-macos

Conversation

@fallofpheonix
Copy link
Copy Markdown
Contributor

@fallofpheonix fallofpheonix commented May 20, 2026

View all comments

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)

Copilot AI review requested due to automatic review settings May 20, 2026 08:55
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 20, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@fallofpheonix
Copy link
Copy Markdown
Contributor Author

Reproduced on Apple LLDB 2100.

po falls back to p because LLDB reports missing Rust language plugin support. path.rs appears to be the only debuginfo test using po.

Submitted a PR replacing po with print and relaxing the checks.

This comment was marked as low quality.

Comment thread tests/debuginfo/path.rs
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 20, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@jieyouxu jieyouxu self-assigned this May 20, 2026
@fallofpheonix
Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense.

I investigated this further on my side as well. I checked an older revision (281c97c) and tests/debuginfo/path.rs still fails for me on Apple LLDB 2100, so it did not look like a recent regression in Rust itself.

path.rs was added for Path / PathBuf pretty printer support, and it appears to be the only debuginfo test currently using po.

The pretty printers still seem to work correctly through print; the failure comes from po falling back to p on Apple LLDB 2100.

If this is indeed related to #147552, I'm happy to adjust the approach or update the PR accordingly.

@workingjubilee
Copy link
Copy Markdown
Member

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.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 21, 2026
Use print instead of po in debuginfo path test


try-job: aarch64-apple
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 21, 2026

☀️ Try build successful (CI)
Build commit: 7ca6154 (7ca61549aa9da0d8349ccec9e4569b85d307fb77, parent: b954122bbe6c4a244c511a9a168c6d5438d8f58f)

@jieyouxu

This comment was marked as outdated.

@jieyouxu jieyouxu closed this May 22, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 22, 2026
@jieyouxu jieyouxu reopened this May 23, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 23, 2026
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

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

View changes since this review

Comment thread tests/debuginfo/path.rs
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu May 23, 2026

Choose a reason for hiding this comment

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

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):

  • po is (typically) aliased to expr --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 thus po) tries to "[e]valuate an expression on the current thread" plus --object-description will 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 (basic expr) 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 to p path or expr path.
  • Also, note that on more recent versions of lldb, print is usually aliases to dwim-print (Do What I Mean™️ print).
  • IOW, I think the original po checks 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 to po path w/ an error message, but at least they still get p path back.

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"

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 23, 2026
@fallofpheonix
Copy link
Copy Markdown
Contributor Author

Updated.

I restored the original print checks and only removed the po command/check pairs as suggested. The test now continues to validate the existing pretty printer output while avoiding the po fallback behavior.

@fallofpheonix
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 23, 2026
@jieyouxu
Copy link
Copy Markdown
Member

@bors try jobs=aarch64-apple

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 23, 2026
Use print instead of po in debuginfo path test


try-job: aarch64-apple
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 23, 2026

☀️ Try build successful (CI)
Build commit: a7dc997 (a7dc9977bcb9500ad27d60cf50a4eec6a19e3ac4, parent: 54333ff079780f803f65dcee30c544050b35f544)

Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 24, 2026

📌 Commit 6ed5bf2 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 24, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 24, 2026

⌛ Testing commit 6ed5bf2 with merge 30e8a87...

Workflow: https://github.com/rust-lang/rust/actions/runs/26354003258

rust-bors Bot pushed a commit that referenced this pull request May 24, 2026
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)
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 24, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #156870.

rust-bors Bot pushed a commit that referenced this pull request May 24, 2026
…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)
@rust-bors rust-bors Bot merged commit 4474668 into rust-lang:main May 24, 2026
12 of 13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests/debuginfo/path.rs test failing on MacOS

7 participants