-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Broken C++ Coverage with hermetic clang toolchain - No override for COVERAGE_GCOV_PATH and LLVM_COV possible with --test_env #23247
Comments
@bazel-io flag |
@bazel-io fork 7.4.0 |
I'm don't know if action_config does anything with the coverage tools - why not have the toolchain specify the path for the tools? |
In Pigweed it was not allowed to mix ActionConfig and plain tool_path, and also now in rules_cc, the toolchain config only accepts a cc_tool_map which is just a list of ActionConfigs. There is no way I can find to inject a plain old tool_path. |
i submitted #24670 |
Fixes bazelbuild#23247 Closes bazelbuild#24768 PiperOrigin-RevId: 707176116 Change-Id: I71ef3c630f8130467cc6a0c730c1278ae6b0817f (cherry picked from commit 03eae37)
Fixes bazelbuild#23247 Closes bazelbuild#24670. PiperOrigin-RevId: 707176116 Change-Id: I71ef3c630f8130467cc6a0c730c1278ae6b0817f
Fixes #23247 Closes #24670. PiperOrigin-RevId: 707176116 Change-Id: I71ef3c630f8130467cc6a0c730c1278ae6b0817f Commit 03eae37 Co-authored-by: Keith Smiley <[email protected]>
A fix for this issue has been included in Bazel 7.5.0 RC2. Please test out the release candidate and report any issues as soon as possible. |
We use I just tested it again, it Bazel 7.1 our value for Are we just using an unsupported feature here or is this bug only partially fixed? |
I think that one is complaining about either |
Description of the bug:
Hello Everyone,
Starting with Bazel 7.2.1 it's no longer possible to generate c++ code coverage using a hermetic Clang toolchain. I am using pw_toolchain_bazel to generate the toolchains definitions. Since our system doesn't have GCOV installed, and would like to use LLVM for the coverage, we override COVERAGE_GCOV_PATH and LLVM_COV with --test_env:
bazelrc content:
By default Bazel extracts these two env variables from the tool_path for GCOV and LLVM_COV, but not from the action_configs for coverage actions.
cc_helper.bzl@1090
Given that the current recommend way is to use action_configs and not tool_paths to define Action Tools, we do not set the tool path for GCOV and LLVM_COV, and their value is set to "".
This was fine since we could override their values using --test_env. However after the change 87b0a1f we can no longer override them.
This is happening because of the change in the order of env variables population in src/main/java/com/google/devtools/build/lib/exec/TestPolicy.java.
Proposed Solutions:
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
WSL Ubuntu 20.04
What is the output of
bazel info release
?release 7.2.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
87b0a1f
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: