-
Notifications
You must be signed in to change notification settings - Fork 434
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
[bug] fix coverage linker flags when using --@rules_rust//rust/settin… #2836
base: main
Are you sure you want to change the base?
Conversation
…gs:experimental_use_cc_common_link=true
0381262
to
8b53d91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I think there's one change left to get passing CI.
.bazelci/presubmit.yml
Outdated
@@ -565,6 +572,8 @@ tasks: | |||
- "//..." | |||
test_targets: | |||
- "//..." | |||
coverage_targets: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll need to add coverage_flags
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😓 I thought test_flags
are inherited as part of coverage?
on main, without my change, bazel coverage
is broken for Build with no_std + alloc using cc_common.link infrastructure for linking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true of .bazelrc
flags but I don't think bazel CI works that way. Perhaps I'm misinterpreting https://github.com/bazelbuild/continuous-integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there coverage flags
? https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/README.md
I don't see any mention of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage is not very well documented in the Bazel ecosystem. I remember seeing this deep in the python code some time ago but don't remember exactly where.
302dc79
to
880da29
Compare
880da29
to
e49556a
Compare
coverage_link_flags = [] | ||
if include_coverage: | ||
# fixes missing symbols coverage fails due to gcc lacking a few linker args | ||
coverage_link_flags = ["-u", "__llvm_profile_runtime"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you're not using gcc?
When running bazel coverage with
--@rules_rust//rust/settings:experimental_use_cc_common_link=true
, we fail to generate coverage properly because of some missing linker flags (the c library as well as some missing symbols)This pr fixes that
resolves #2729