Skip to content
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

bazel coverage generating empty coverage.dat on single workspace #16515

Closed
Sinn opened this issue Oct 20, 2022 · 4 comments
Closed

bazel coverage generating empty coverage.dat on single workspace #16515

Sinn opened this issue Oct 20, 2022 · 4 comments
Labels
duplicate team-Rules-Server Issues for serverside rules included with Bazel type: bug untriaged

Comments

@Sinn
Copy link

Sinn commented Oct 20, 2022

Description of the bug:

WARNING: There was no coverage found.
stat bazel-out/_coverage/_coverage_report.dat
  File: bazel-out/_coverage/_coverage_report.dat
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

bazel clean ; bazel coverage --combined_report=lcov --instrumentation_filter='' --nocache_test_results src/base:expected_test

Which operating system are you running Bazel on?

PRETTY_NAME="Debian GNU/Linux rodete" NAME="Debian GNU/Linux" VERSION_ID="rodete" VERSION="12 (rodete)" VERSION_CODENAME=rodete ID=debian

What is the output of bazel info release?

release 5.3.2

If bazel info release returns development 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 master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

Nope, seem to be other people running into it, but this project has nothing special,so its surprising that the coverage reports are emtpy.

Any other information, logs, or outputs that you want to share?

Testing an C++20 expected impl, so the target is a header file lib, and test is just running through specializations.

Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main getTracefiles
INFO: Found 1 tracefiles.
Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main parseFilesSequentially
INFO: Parsing file bazel-out/k8-fastbuild/testlogs/src/base/expected_test/coverage.dat
Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main getGcovInfoFiles
INFO: No gcov info file found.
Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main getGcovJsonInfoFiles
INFO: No gcov json file found.
Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main getProfdataFileOrNull
INFO: No .profdata file found.
Oct 19, 2022 10:09:14 PM com.google.devtools.coverageoutputgenerator.Main runWithArgs
WARNING: There was no coverage found.
Target //src/base:expected_test up-to-date:
  bazel-bin/src/base/expected_test

I tried --nocache_test_results, bazel clean -> then retry nothing seems to generate the report.

bazelrc

# Use clang by default
build --repo_env=CC=clang

# C++20
build --cxxopt='-std=c++20' 

# Warnings
build --cxxopt='-Wall'
build --cxxopt='-Werror'
build --cxxopt='-Wextra'
build --cxxopt='-Wextra-semi'
build --cxxopt='-Wconversion'
build --cxxopt='-Wnewline-eof'
build --cxxopt='-Wstrict-prototypes'
build --cxxopt='-Wold-style-cast'
build --cxxopt='-Wno-unused-parameter'
build --cxxopt='-Wnonportable-system-include-path'
build --cxxopt='-Wwrite-strings'
build --cxxopt='-Wimplicit-fallthrough'

# Configuration
build --cxxopt='-fno-exceptions'
build --cxxopt='-fno-rtti'
build --cxxopt='-fomit-frame-pointer'
build --cxxopt='-funwind-tables'
@sgowroji
Copy link
Member

sgowroji commented Oct 20, 2022

Dupe of #16208, #15254

@sgowroji sgowroji added team-Rules-Server Issues for serverside rules included with Bazel untriaged duplicate type: bug labels Oct 20, 2022
@Sinn
Copy link
Author

Sinn commented Oct 21, 2022

I'm slightly confused by what you mean 'external' repositories. All the code being tested here is under the projects workspace.

bazel coverage -c dbg --nocache_test_results --combined_report=lcov //src/base:expected_test

I dont see any external repository referenced at all, so think the duplicate tag is not correct.
Tested the available tools by instrumenting manually, and generating the report manually, and it worked, so my toolchain is doing its job.

@Sinn Sinn changed the title bazel coverage generating empty coverage.dat bazel coverage generating empty coverage.dat on single workspace Oct 21, 2022
@Sinn
Copy link
Author

Sinn commented Oct 21, 2022

There was a mixup of llvm and gcc, nvm.

slack discussion: https://bazelbuild.slack.com/archives/CA31HN1T3/p1666335963259669

@Sinn Sinn closed this as completed Oct 21, 2022
@simonhgao
Copy link

Hi, I meet same problem, is there anyone can help here? I could not see the discussion in slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate team-Rules-Server Issues for serverside rules included with Bazel type: bug untriaged
Projects
None yet
Development

No branches or pull requests

3 participants