Skip to content

ferrocene: wire LLVM coverage tools into generated rust_toolchain - #34

Merged
dcalavrezo-qorix merged 1 commit into
mainfrom
dcalavrezo_llvm_cov
Jul 24, 2026
Merged

ferrocene: wire LLVM coverage tools into generated rust_toolchain#34
dcalavrezo-qorix merged 1 commit into
mainfrom
dcalavrezo_llvm_cov

Conversation

@dcalavrezo-qorix

Copy link
Copy Markdown
Contributor

coverage-tools tarballs from ferrocene_toolchain_builder >= 1.3.0 additionally ship llvm-cov, llvm-profdata and llvm-cxxfilt built from the same LLVM tree as the Ferrocene rustc.

ferrocene_toolchain_ext now detects these tools after extracting the coverage-tools archive and sets llvm_cov/llvm_profdata on the generated rust_toolchain. This is what makes rules_rust instrument crates (--codegen=instrument-coverage) and export RUST_LLVM_COV / RUST_LLVM_PROFDATA to the coverage runner under 'bazel coverage' - without it, Rust code silently produces no coverage data.

  • expose llvm-cov-bin / llvm-profdata-bin / llvm-cxxfilt-bin filegroups from the generated repo
  • bump all ferrocene_toolchain_builder pins 1.2.0 -> 1.3.0; only the coverage-tools tarball changed content, all other 1.3.0 assets are byte-identical to the previously pinned 1.2.0 ones (checksums verified)

Backward compatible: coverage-tools tarballs without the llvm tools (<= 1.2.0) simply skip the wiring.

coverage-tools tarballs from ferrocene_toolchain_builder >= 1.3.0
additionally ship llvm-cov, llvm-profdata and llvm-cxxfilt built from
the same LLVM tree as the Ferrocene rustc.

ferrocene_toolchain_ext now detects these tools after extracting the
coverage-tools archive and sets llvm_cov/llvm_profdata on the generated
rust_toolchain. This is what makes rules_rust instrument crates
(--codegen=instrument-coverage) and export RUST_LLVM_COV /
RUST_LLVM_PROFDATA to the coverage runner under 'bazel coverage' -
without it, Rust code silently produces no coverage data.

- expose llvm-cov-bin / llvm-profdata-bin / llvm-cxxfilt-bin filegroups
  from the generated repo
- bump all ferrocene_toolchain_builder pins 1.2.0 -> 1.3.0; only the
  coverage-tools tarball changed content, all other 1.3.0 assets are
  byte-identical to the previously pinned 1.2.0 ones (checksums
  verified)

Backward compatible: coverage-tools tarballs without the llvm tools
(<= 1.2.0) simply skip the wiring.

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems okay from my side.

@dcalavrezo-qorix
dcalavrezo-qorix merged commit 64cc4bb into main Jul 24, 2026
5 checks passed
@dcalavrezo-qorix
dcalavrezo-qorix deleted the dcalavrezo_llvm_cov branch July 24, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants