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

dangling symbolic link with --experimental_fetch_all_coverage_outputs #23718

Open
oliverlee opened this issue Sep 23, 2024 · 1 comment
Open
Assignees
Labels
coverage P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug

Comments

@oliverlee
Copy link
Contributor

Description of the bug:

I am trying to retain the .gcov files from running coverage and am using --experimental_fetch_all_coverage_outputs mentioned here. When I run the coverage command, I get an error

Sep 23, 2024 5:49:19 PM com.google.devtools.coverageoutputgenerator.Main getTracefiles
INFO: No lcov file found.
Sep 23, 2024 5:49:19 PM com.google.devtools.coverageoutputgenerator.Main getGcovInfoFiles
INFO: Found 1 gcov info files.
Sep 23, 2024 5:49:19 PM com.google.devtools.coverageoutputgenerator.Main parseFilesSequentially
INFO: Parsing file /private/var/tmp/_bazel_oliver/428b4df1ffa12884ed645567c097dd18/sandbox/darwin-sandbox/37/execroot/coverage-example/bazel-out/darwin_arm64-fastbuild/testlogs/test/lib_test/_coverage/_cc_coverage.gcov
Sep 23, 2024 5:49:19 PM com.google.devtools.coverageoutputgenerator.Main getGcovJsonInfoFiles
INFO: No gcov json file found.
Sep 23, 2024 5:49:19 PM com.google.devtools.coverageoutputgenerator.Main getProfdataFileOrNull
INFO: No .profdata file found.
================================================================================
ERROR: /Users/oliver/repos/basic-coverage-example/test/BUILD.bazel:1:8: Error while validating output TreeArtifact File:[[<execution_root>]bazel-out/darwin_arm64-fastbuild/testlogs]test/lib_test/_coverage : Child gcov of tree artifact /private/var/tmp/_bazel_oliver/428b4df1ffa12884ed645567c097dd18/execroot/coverage-example/bazel-out/darwin_arm64-fastbuild/testlogs/test/lib_test/_coverage is a dangling symbolic link
ERROR: /Users/oliver/repos/basic-coverage-example/test/BUILD.bazel:1:8: Testing //test:lib_test failed: not all outputs were created or valid

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.

clone https://github.com/oliverlee/basic-coverage-example and run:

bazel coverage //... --instrumentation_filter=//:lib --config=gcov --experimental_fetch_all_coverage_outputs

Which operating system are you running Bazel on?

macOS 14.6

What is the output of bazel info release?

7.1.0

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 HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

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

No response

@oliverlee
Copy link
Contributor Author

It does appear that all gcda files are available if --keep_going is passed to coverage:

❯  fd --no-ignore gcda bazel-testlogs | wc -l
     304

@iancha1992 iancha1992 added the team-Rules-CPP Issues for C++ rules label Sep 24, 2024
@c-mita c-mita self-assigned this Oct 15, 2024
@c-mita c-mita added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

5 participants