Ship llvm-cov and llvm-profdata with coverage_files - #856
Open
AustinSchuh wants to merge 2 commits into
Open
Conversation
The rule-based cc_toolchain's coverage_files group was empty (a TODO: action_names.bzl lists no actions for coverage), so a toolchain whose llvm_cov / llvm_profdata tools are files -- a hermetic LLVM distribution -- cannot collect llvm-format coverage: the environment points collect_cc_coverage.sh at the right execroot-relative llvm-profdata path, but the binary is not among the coverage test action's inputs, and collection fails with .../bin/llvm-profdata: No such file or directory The legacy cc_toolchain never hit this because its coverage_files attribute defaults to all_files. Toolchains whose coverage tools are absolute paths (xcrun shims, /usr/bin/gcov) are unaffected either way. Verified with toolchains_llvm's darwin toolchain: with this change, `bazel coverage --experimental_use_llvm_covmap --experimental_generate_llvm_lcov` produces a populated lcov report where it previously failed outright. Signed-off-by: Austin Schuh <austin.linux@gmail.com>
keith
reviewed
Aug 29, 2026
Same reasoning as llvm-cov and llvm-profdata: a toolchain whose gcov tool is a file rather than an absolute path needs it among the coverage test action's inputs. Signed-off-by: Austin Schuh <austin.linux@gmail.com>
AustinSchuh
force-pushed
the
coverage-files
branch
from
August 29, 2026 02:01
725df5e to
8f9e669
Compare
keith
approved these changes
Aug 29, 2026
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.
The rule-based cc_toolchain's coverage_files group was empty (a TODO: action_names.bzl lists no actions for coverage), so a toolchain whose llvm_cov / llvm_profdata tools are files -- a hermetic LLVM distribution -- cannot collect llvm-format coverage: the environment points collect_cc_coverage.sh at the right execroot-relative llvm-profdata path, but the binary is not among the coverage test action's inputs, and collection fails with
.../bin/llvm-profdata: No such file or directory
The legacy cc_toolchain never hit this because its coverage_files attribute defaults to all_files. Toolchains whose coverage tools are absolute paths (xcrun shims, /usr/bin/gcov) are unaffected either way.
Verified with toolchains_llvm's darwin toolchain: with this change,
bazel coverage --experimental_use_llvm_covmap --experimental_generate_llvm_lcovproduces a populated lcov report where it previously failed outright.