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

Promote coverage_common.instrumented_files_info.coverage_support_files to a public API #18697

Closed
UebelAndre opened this issue Jun 15, 2023 · 7 comments
Assignees
Labels
coverage team-Rules-Server Issues for serverside rules included with Bazel type: feature request untriaged

Comments

@UebelAndre
Copy link
Contributor

Description of the feature request:

Could coverage_common.instrumented_files_info.coverage_support_files be promoted to a public API?

What underlying problem are you trying to solve with this feature?

Trying to get coverage working in rules_rust lead to the discovery of coverage_common.instrumented_files_info.coverage_support_files which I wanted to use to add llvm-cov and llvm-profdata to the coverage post-processing action but couldn't because it was a private API. I don't think these binaries should be runfiles of the test binary being defined in the rule, instead, I'd like to some how add them only to actions that will be running coverage. This field seems appropriate since the tools are indeed support files.

Which operating system are you running Bazel on?

Linux, MacOS

What is the output of bazel info release?

release 6.2.1

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?

No response

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

https://bazelbuild.slack.com/archives/CA31HN1T3/p1686230133034699 is the slack conversation that spawned this request.

@c-mita
Copy link
Member

c-mita commented Jun 26, 2023

Would you also need coverage_environment and metadata_files? The latter is easy enough, but the former is really tied into collect_coverage.sh and collect_cc_coverage.sh (via _collect_coverage and _collect_cc_coverage).

I've always considered those scripts somewhat as "internal magic", but I'm aware that some people seek to override them, and I think we need to formalise things somewhat before I open up coverage_environment.

Any thoughts on this @fmeum ?

@c-mita c-mita self-assigned this Jun 26, 2023
@UebelAndre
Copy link
Contributor Author

Formalizing this would be great! I feel coverage in general is internal magic and it’d be fantastic to be able to have well defined contracts where I can insert my own coverage tooling and hand off intermediate files for Bazel to process and combine into the larger report

@fmeum
Copy link
Collaborator

fmeum commented Jun 27, 2023

@c-mita I agree that coverage_environment is too heavily tied to collect_cc_coverage.sh implementation details to open up.

metadata_files seems benign and generally useful enough. How about opening up just this attribute and cherry-picking that change to 6.3.0? Then we could do a survey of what exactly is missing for full coverage support for the remaining popular languages.

@c-mita
Copy link
Member

c-mita commented Jun 30, 2023

I think that's ok, although I'm not sure how useful it is on its own right now.
I have an internal change to do this, pending review.

@c-mita
Copy link
Member

c-mita commented Jul 4, 2023

The metadata_files parameter is exposed at HEAD (ef54ef5).
#18838 is a PR to pick the required change(s) onto 6.3.0.

@comius
Copy link
Contributor

comius commented Aug 4, 2023

@c-mita please triage

@c-mita
Copy link
Member

c-mita commented Aug 8, 2023

I'm closing this for now; one parameter has already been exposed that can actually achieve the same thing.

I would much rather pursue follow ups to https://docs.google.com/document/d/1JP-9pjiRBHmepgFzBI-U9G2nAzCWK5YoemGVVKmQsBM/ then ad-hoc incremental changes without a larger vision.

@c-mita c-mita closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage team-Rules-Server Issues for serverside rules included with Bazel type: feature request untriaged
Projects
None yet
Development

No branches or pull requests

7 participants