Closed phst closed 1 year ago
can you test with the experimental LLVM cov flag and see if that works for your case?
Sorry, what's the "experimental LLVM cov flag"?
At least on my machine that flag breaks coverage entirely, with similar symptoms as https://github.com/bazelbuild/bazel/issues/14970 (attempts to call gcov merge
instead of llvm-cov merge
).
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage
). Thanks!
This looks similar to https://github.com/bazelbuild/bazel/issues/19338.
@phst Are you still seeing this? See https://github.com/bazelbuild/bazel/pull/19349 for a PR with tests for this.
Description of the problem / feature request:
Even with workarounds for https://github.com/bazelbuild/bazel/issues/10457 in place,
bazel coverage
doesn't produce coverage instrumentation for inline functions defined in header files.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
BUILD file:
lib.h:
lib.cc:
test.cc:
Then, run
The GCOV_PREFIX_STRIP is for https://github.com/bazelbuild/bazel/issues/10457.
The resulting coverage.dat then has contents for lib.cc, but not lib.h.
Te file _cc_coverage.gcov, which lcov_merger uses as source file, has entries for lib.cc and ./lib.h (note the
./
in ./lib.h). My guess is thus that https://github.com/bazelbuild/bazel/blob/5.0.0/tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator/Coverage.java#L77 shouldn't use plain string comparison, but normalize the filenames first.What operating system are you running Bazel on?
macOS 12.2.1
What's the output of
bazel info release
?release 5.0.0-homebrew
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Nothing (not in a Git repository)
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/10457 is somewhat related (albeit a bit pessimistic; coverage on macOS does work in general), but doesn't seem to touch on this specific bug.
Any other information, logs, or outputs that you want to share?
Logs