Skip to content

compiletest: cdb version detection locally seems funky #133110

Open
@jieyouxu

Description

@jieyouxu
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

Activity

added
A-compiletestArea: The compiletest test runner
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
C-bugCategory: This is a bug.
E-needs-investigationCall for partcipation: This issues needs some investigation to determine current status
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Nov 16, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Nov 16, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Nov 16, 2024
ChrisDenton

ChrisDenton commented on Nov 16, 2024

@ChrisDenton
Member

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

jieyouxu commented on Nov 16, 2024

@jieyouxu
MemberAuthor

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

ChrisDenton commented on Nov 16, 2024

@ChrisDenton
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

ChrisDenton commented on Nov 16, 2024

@ChrisDenton
Member

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

removed
E-needs-investigationCall for partcipation: This issues needs some investigation to determine current status
on Nov 16, 2024
jieyouxu

jieyouxu commented on Nov 16, 2024

@jieyouxu
MemberAuthor

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

ChrisDenton commented on Nov 16, 2024

@ChrisDenton
Member

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

jieyouxu

jieyouxu commented on Nov 16, 2024

@jieyouxu
MemberAuthor

Ah right. Forgot about that.

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Nov 17, 2024
hkBst

hkBst commented on Jan 22, 2025

@hkBst
Member

What doc changes would you like to see here?

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
and removed
C-bugCategory: This is a bug.
on Jan 22, 2025
jieyouxu

jieyouxu commented on Jan 22, 2025

@jieyouxu
MemberAuthor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ChrisDenton@hkBst@jieyouxu@rustbot

        Issue actions

          compiletest: cdb version detection locally seems funky · Issue #133110 · rust-lang/rust