Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debuginfo tests don't control for ambient tools #126092

Open
workingjubilee opened this issue Jun 6, 2024 · 11 comments
Open

Debuginfo tests don't control for ambient tools #126092

workingjubilee opened this issue Jun 6, 2024 · 11 comments
Labels
A-compiletest Area: The compiletest test runner A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) WG-debugging Working group: Bad Rust debugging experiences

Comments

@workingjubilee
Copy link
Member

The debuginfo tests should probably use a specific debugger, like maybe an lldb we build with the compiler, so that they work consistently. In practice, they have been effectively broken on user's machines by just trying to use whatever is installed.

In other words: just because I use Linux doesn't mean I have gdb installed.

@workingjubilee workingjubilee added the C-bug Category: This is a bug. label Jun 6, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 6, 2024
@workingjubilee workingjubilee added A-testsuite Area: The testsuite used to check the correctness of rustc A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) WG-debugging Working group: Bad Rust debugging experiences T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 6, 2024
@workingjubilee
Copy link
Member Author

workingjubilee commented Jun 6, 2024

The debuginfo test suite should also be insulated against gdb changing how it prints things, Because It Does.

@Noratrieb
Copy link
Member

Some points:

  • compiletest supports cdb, gdb and lldb, running the test suite for all the ones that are available (either via config.toml or via PATH).
  • our LLVM builds do currently not contain lldb.

@workingjubilee
Copy link
Member Author

That's... informative, thank you!

It does seem like we should reassess our strategy if we're gonna run a test suite that isn't guaranteed to pass even between different versions of a debugger on "any ol' random debugger lying around".

@bjorn3
Copy link
Member

bjorn3 commented Jun 8, 2024

On macOS we can't ship our own debugger. Only an Apple signed lldb is allowed to use the debugging apis of the kernel.

@workingjubilee
Copy link
Member Author

Wait, gdb is useless on macOS?

@bjorn3
Copy link
Member

bjorn3 commented Jun 8, 2024

Supposedly you can use gdb on macOS jf you sign it with a self-signed code signing certificate which you add to the system keychain, mark as trusted for code signing and set the right entitlements when signing gdb. I don't know if you need to disable SIP for this to work though. We can't disable SIP on CI. https://dev.to/jasonelwood/setup-gdb-on-macos-in-2020-489k

@workingjubilee
Copy link
Member Author

Hmm, okay. I think on Linux it is still desirable to control for the sheer amount of variability that Linux distros have, but I can believe that the debuginfo tests have to draw on the environment sometimes.

@jieyouxu
Copy link
Member

jieyouxu commented Jun 9, 2024

I think it's fine if we can't necessarily control for the debugger used, but we should at least document it and/or report the debugger used when running the debuginfo test suite.

@workingjubilee
Copy link
Member Author

yeah, that was also reported as #126628

@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label Jun 24, 2024
@saethlin
Copy link
Member

FYI all of the lldb tests have been failing for anyone who uses a rolling distro for the past 8 months because of llvm/llvm-project#70453

@jieyouxu
Copy link
Member

In case anyone stumbled across this, IIRC lldb debuginfo tests (currently) require Python 3.10 dll to be present in PATH on Windows, not sure about Unixes but presumably only working with Python 3.10 is well-behaved.

@jieyouxu jieyouxu added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. and removed E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) WG-debugging Working group: Bad Rust debugging experiences
Projects
Development

No branches or pull requests

6 participants