Explicitly materialize debuginfo tests for all debuggers#159177
Open
Kobzol wants to merge 2 commits into
Open
Conversation
Collaborator
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
It can be represented by the `ignore_message` being `Some`, to avoid duplicated and potentially inconsistent state.
380c42e to
ed659fa
Compare
Collaborator
|
|
Member
|
cf. #126628 too |
jieyouxu
reviewed
Jul 13, 2026
Comment on lines
+567
to
+571
| configs.extend([ | ||
| Arc::new(Config { debugger: Some(Debugger::Cdb), ..config.as_ref().clone() }), | ||
| Arc::new(Config { debugger: Some(Debugger::Gdb), ..config.as_ref().clone() }), | ||
| Arc::new(Config { debugger: Some(Debugger::Lldb), ..config.as_ref().clone() }), | ||
| ]); |
Member
There was a problem hiding this comment.
Discussion: yeah, I can't say I'm a huge fan of doing 3 copies of the config, cf. thread #t-infra/bootstrap > compiletest CLI parsing @ 💬
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When testing #158298, I realized that when you don't have a given debugger (CDB, GDB, LLDB) available, compiletest will silently skip generating "variants" of debuginfo tests for a given debugger. So if you run a single debuginfo test, it will run 0/1/2/3 tests, based on what debuggers you have available. So it will show
running 1/2/3 testswithout telling you that it is actually three separate tests, but some of them were automatically ignored.This is made even worse by the fact that bootstrap/compiletest currently automatically discovers debuggers, so there is a lot of implicit behavior stacked on top of each other.
This PR changes that, so that compiletest always creates all three variants of the tests, but if you don't have a debugger X available, then the X variant will be ignored, so you can see clearly in the output that it was ignored and why, which is much better than the test simply disappearing.
So after running a given debuginfo test, you will see e.g. this:
Which makes it more more obvious that there are in fact three separate tests, but some of them are ignored (and why).
The way this is achieved is a bit hacky, but that is caused by the previous way compiletest did things. To simulate the three variants of each debuginfo test, compiletest currently generates a separate instance (!) of the
Configfor each debugger, in therun_testsfunction. That's quite hacky, to say the least, and it requires storing adebuggerfield in theConfig, which specifies for which variant we are currently running the debuginfo test.I wanted to try using a single config, and encoding the CDB/GDB/LLDB variants as revisions instead. However, I found out that some debuginfo tests actually do use revisions for.. actual revisions, which caught me by surprise. So we would either need to expand the set of used revisions, so that if the test has e.g.
revision=lto,revision=no-lto, we would then turn that into:revision=lto-cdbrevision=lto-gdbrevision=no-lto-cdbrevision=no-lto-gdbrevision=no-lto-lldbThat's maybe not such a bad solution, and it would allow us to use a single
Configinstance, but it would also require either encoding the debugger inside the revision string and then parsing it out (ugh), or turning revisions into a struct that would contain multiple information (such as the debugger used and then the revision name).Or we could introduce a separate mechanism for "multiplying" tests, but we already have revisions, and it seems overkill to introduce something like this only for debuggers (unless it is also needed at other places...).
So what I did in this PR instead is to keep the three separate configs, but rather than not generating the Config when a debugger is missing, we always generate a separate config for each debugger, but then we ignore tests that do not match the "active" debugger in the Config. Because this ignore logic is not per directive line, but per test, so I had to introduce a new block of code that does that, but that seems fine to me, when compared to the mountain of hacks already present in this part of the codebase xD
This is implemented in the second commit, the first commit is just a small simplification refactoring.
r? @jieyouxu
Fixes: #126628