Skip to content

Commit

Permalink
Correctly forward InstrumentedFilesInfo from dependencies (#3294)
Browse files Browse the repository at this point in the history
This is required with coverage_output_generator v2.6 used by Bazel@HEAD,
which filters LCOV files to contain only those source mentioned in the
provider.
  • Loading branch information
fmeum committed Sep 14, 2022
1 parent fc2afba commit ba48db5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions go/private/rules/library.bzl
Expand Up @@ -52,6 +52,12 @@ def _go_library_impl(ctx):
DefaultInfo(
files = depset([archive.data.file]),
),
coverage_common.instrumented_files_info(
ctx,
source_attributes = ["srcs"],
dependency_attributes = ["data", "deps", "embed", "embedsrcs"],
extensions = ["go"],
),
OutputGroupInfo(
cgo_exports = archive.cgo_exports,
compilation_outputs = [archive.data.file],
Expand Down
2 changes: 1 addition & 1 deletion go/private/rules/test.bzl
Expand Up @@ -181,7 +181,7 @@ def _go_test_impl(ctx):
coverage_common.instrumented_files_info(
ctx,
source_attributes = ["srcs"],
dependency_attributes = ["deps", "embed"],
dependency_attributes = ["data", "deps", "embed", "embedsrcs"],
extensions = ["go"],
),
testing.TestEnvironment(env),
Expand Down

0 comments on commit ba48db5

Please sign in to comment.