bazel
bazel copied to clipboard
Stop listing `.gcno` files as outputs when using LLVM coverage map format
When using --experimental_use_llvm_covmap
, no .gcno
files are output. By listing them as outputs there is a mismatch between expected and actual outputs. Bazel will create these empty files after the action is run, but they non-deterministically get counted in the Action
outputs, which can lead to cache misses on subsequent runs.
Cc @c-mita
@bazel-io flag
@bazel-io fork 7.2.0
I'm pretty sure this will break something, at least internally; coverage flags in our toolchains are predicated on the presence of the "gcov_gcno_file" variable (although I don't think this is the case for Bazel's default toolchain), which is passed when these files are declared.
I think more of a refactor is needed before a change like this can be made.
What compromise can I make to get this over the finish line? I would really like this to get into 7.2.0, as it's a big source of cache misses for us.
Basically, there needs to be another way of entering this branch https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/CompileBuildVariables.java;l=372
I am pretty sure the actual value doesn't matter and nobody depends on it, only its presence.
So I can pass down an empty string when isCodeCoverageEnabled
, and that should satisfy it? If so, I can add a comment on why we are doing that, and call it good.
@c-mita I made a change. LMK what you think.