-
Notifications
You must be signed in to change notification settings - Fork 442
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
Code coverage support #690
Comments
forget i said anything about crates: https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/source-based-code-coverage.html i've got a sample working locally outside of Bazel, which uses i'm happy to contribute if lib maintainers can help me with a direction? |
Hey, I'm not super familiar with how coverage works but do think it should be something the rules support. I'm wondering if other maintainers might be able to shine some light on this? @hlopko @dfreese pinging you two because you seem to be pretty knowledgeable about some subtle details of Bazel and rustc. Hoping you'll have some thoughts 😄 |
Good references should be from rules_go:
Generally Bazel's coverage is not yet complete. |
CC @c-mita (I hear they're looking into coverage these days :) |
#1077 seems relates |
I've been looking into this a bit, and it's definitely possible today by using the C++ related coverage script attribute. It feels a bit like a hack but afaict there still no real movement in bazel around this. |
@keith What's this coverage script attribute? |
Here's a super WIP version #1324 |
FWIW I think that's our best shot at having working coverage for Rust anytime soon. Took a super-quick look and the PR looks reasonable. Thanks for working on it @keith! |
Thanks @hlopko ! |
I have a personal desire to fix this; to create a general interface for rules to use to support coverage collection (along with cross-language support). But other things have stolen my time. The |
Yea I haven't addressed _lcov_merger, but am using _collect_cc_coverage in #1324, should work fine for now |
Does #1324 address the concerns here? |
I've been poking at our bazel setup to see why we don't get coverage, and it seems the rules_rust coverage data is incompatible with Should I file a separate bug for that, or is this bug being used as a tracking bug for coverage for rust in general? |
same for me, it looks like coverage is not created when I have the flag |
Hey authors of
rules_rust
,Has there been any consideration yet regarding source coverage with
rules_rust
? Using projects likecargo-cov
, orcargo-tarpaulin
, it looks pretty easy from the outside but perhaps not from within Bazel.IIRC,
instrumented_files=
would need to be provided for Rust targets, but that part is relatively easy if there is already a tool that can producelcov
-compatible outputs.The text was updated successfully, but these errors were encountered: