Skip to content

coverage-dump: Resolve global file IDs to filenames #140251

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

Merged
merged 6 commits into from
May 6, 2025

Conversation

Zalathar
Copy link
Contributor

The coverage-dump tool, used by coverage tests, currently includes “global file ID” numbers in its dump output.

This PR adds support for parsing coverage filename information from LLVM assembly .ll files, and resolving those file IDs to the corresponding filename, for inclusion in dump output.

This makes dump output more informative, especially for test cases involving multiple files, and will be important for testing expansion region support in the future.


The bootstrap changes don't necessarily have to land at the same time (e.g. they could be deferred to after the stage0 redesign if requested), but I would prefer to land them now if possible.

@Zalathar Zalathar added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Apr 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 24, 2025

r? @clubby789

rustbot has assigned @clubby789.
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

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 24, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@Zalathar Zalathar force-pushed the coverage-dump-path branch from e2a47cd to 447d537 Compare April 25, 2025 03:05
@clubby789
Copy link
Contributor

clubby789 commented Apr 25, 2025

The bootstrap step additions look reasonable to me (aside from some minor notes)

@Zalathar Zalathar force-pushed the coverage-dump-path branch 2 times, most recently from aca0f34 to c65fc17 Compare April 26, 2025 03:24
@Zalathar
Copy link
Contributor Author

Rebased, then addressed review feedback, and added some relevant FIXMEs and other comments (diff).

@Zalathar Zalathar force-pushed the coverage-dump-path branch from c65fc17 to ea61bce Compare May 4, 2025 03:44
@Zalathar
Copy link
Contributor Author

Zalathar commented May 4, 2025

(Rebased; no changes.)

Copy link
Contributor

@clubby789 clubby789 left a comment

Choose a reason for hiding this comment

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

Changes LGTM aside from a small nit, r=me with or without it

This also causes the coverage-dump unit tests to run in CI and `./x test` by
default.
@Zalathar Zalathar force-pushed the coverage-dump-path branch from ea61bce to dfc04ed Compare May 6, 2025 01:53
@Zalathar Zalathar force-pushed the coverage-dump-path branch from dfc04ed to c53a767 Compare May 6, 2025 02:00
@Zalathar
Copy link
Contributor Author

Zalathar commented May 6, 2025

Rebased, and renamed llvm_junk to llvm_utils (diff).

@bors r=clubby789 rollup

@bors
Copy link
Collaborator

bors commented May 6, 2025

📌 Commit c53a767 has been approved by clubby789

It is now in the queue for this repository.

@bors bors 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 6, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request May 6, 2025
…bby789

coverage-dump: Resolve global file IDs to filenames

The coverage-dump tool, used by coverage tests, currently includes “global file ID” numbers in its dump output.

This PR adds support for parsing coverage filename information from LLVM assembly `.ll` files, and resolving those file IDs to the corresponding filename, for inclusion in dump output.

This makes dump output more informative, especially for test cases involving multiple files, and will be important for testing expansion region support in the future.

---

The bootstrap changes don't necessarily have to land at the same time (e.g. they could be deferred to after the stage0 redesign if requested), but I would prefer to land them now if possible.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#139550 (Fix `-Zremap-path-scope` rmeta handling)
 - rust-lang#139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - rust-lang#140035 (Implement RFC 3503: frontmatters)
 - rust-lang#140176 (Fix linking statics on Arm64EC)
 - rust-lang#140251 (coverage-dump: Resolve global file IDs to filenames)
 - rust-lang#140393 (std: get rid of `sys_common::process`)
 - rust-lang#140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - rust-lang#140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - rust-lang#140634 (Use more accurate ELF flags on MIPS)
 - rust-lang#140673 (Clean rustdoc tests folder)
 - rust-lang#140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - rust-lang#140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#139550 (Fix `-Zremap-path-scope` rmeta handling)
 - rust-lang#139764 (Consistent trait bounds for ExtractIf Debug impls)
 - rust-lang#139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - rust-lang#140035 (Implement RFC 3503: frontmatters)
 - rust-lang#140251 (coverage-dump: Resolve global file IDs to filenames)
 - rust-lang#140393 (std: get rid of `sys_common::process`)
 - rust-lang#140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - rust-lang#140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - rust-lang#140634 (Use more accurate ELF flags on MIPS)
 - rust-lang#140673 (Clean rustdoc tests folder)
 - rust-lang#140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - rust-lang#140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 42156bd into rust-lang:master May 6, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone May 6, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup merge of rust-lang#140251 - Zalathar:coverage-dump-path, r=clubby789

coverage-dump: Resolve global file IDs to filenames

The coverage-dump tool, used by coverage tests, currently includes “global file ID” numbers in its dump output.

This PR adds support for parsing coverage filename information from LLVM assembly `.ll` files, and resolving those file IDs to the corresponding filename, for inclusion in dump output.

This makes dump output more informative, especially for test cases involving multiple files, and will be important for testing expansion region support in the future.

---

The bootstrap changes don't necessarily have to land at the same time (e.g. they could be deferred to after the stage0 redesign if requested), but I would prefer to land them now if possible.
@Zalathar Zalathar deleted the coverage-dump-path branch May 6, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

4 participants