Skip to content

compiletest: cdb version detection locally seems funky #133110

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

Open
jieyouxu opened this issue Nov 16, 2024 · 9 comments
Open

compiletest: cdb version detection locally seems funky #133110

jieyouxu opened this issue Nov 16, 2024 · 9 comments
Labels
A-compiletest Area: The compiletest test runner A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

While investigating #133107, it seems that even if I have a suitably-versioned cdb e.g. 10.0.26100.2161 in PATH, compiletest cdb version detection seems to consider that I failed to satisfy

//@ min-cdb-version: 10.0.26100.2161
@jieyouxu jieyouxu added A-compiletest Area: The compiletest test runner A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 16, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 16, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 16, 2024
@ChrisDenton
Copy link
Member

ChrisDenton commented Nov 16, 2024

Looks like it just hard codes the path, aside from using ProgramFiles(x86) environment variable as the base directory:

fn find_cdb(target: &str) -> Option<OsString> {

@jieyouxu
Copy link
Member Author

jieyouxu commented Nov 16, 2024

That's kinda what I expected yeah. On one hand it saves you from having to manually specify it in PATH. On the other hand...

@ChrisDenton
Copy link
Member

The simplest fix would be to check PATH first then fallback. However, it would be important to make sure that doesn't cause issues. E.g. we had problems with there being a msys2 link.exe that is not at all related to msvc's link.exe.

@ChrisDenton
Copy link
Member

ChrisDenton commented Nov 16, 2024

That said, I would note that there is a --cdb option for providing a path manually.

@jieyouxu jieyouxu removed the E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status label Nov 16, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Nov 16, 2024

That said, I would note that there is a --cdb option for providing a path manually.

AFAIK compiletest's cli are mostly for use by bootstrap, I'm not sure if that actually works. Maybe ./x test debuginfo -- --cdb=... but I haven't double-checked yet.

@ChrisDenton
Copy link
Member

x test debuginfo --test-args --cdb=... should always work, no? The purpose of --test-args is to ensure arguments are passed through.

@jieyouxu
Copy link
Member Author

Ah right. Forgot about that.

@jieyouxu jieyouxu added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Nov 17, 2024
@hkBst
Copy link
Member

hkBst commented Jan 22, 2025

What doc changes would you like to see here?

@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed C-bug Category: This is a bug. labels Jan 22, 2025
@jieyouxu
Copy link
Member Author

Something simple like the following would go a long way:

  • That cdb detection will look for a local cdb through a hard-coded search under ProgramFiles(x86) or ProgramFiles depending on host, and does not respect PATH.
  • How to pass a custom cdb, e.g. ./x test debuginfo --test-args --cdb=....

Probably send the doc PR against rustc-dev-guide and not here.

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-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

No branches or pull requests

4 participants