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

Coverage is broken in rules_go 0.19.0 with nogo #2146

Closed
prestonvanloon opened this issue Jul 16, 2019 · 2 comments · Fixed by #2148
Closed

Coverage is broken in rules_go 0.19.0 with nogo #2146

prestonvanloon opened this issue Jul 16, 2019 · 2 comments · Fixed by #2148

Comments

@prestonvanloon
Copy link
Contributor

This is a bazel coverage //... run:

ERROR: /home/preston/go-packages/src/github.com/prysmaticlabs/prysm/BUILD.bazel:78:1: in nogo rule //:nogo:
Traceback (most recent call last):
        File "/home/preston/go-packages/src/github.com/prysmaticlabs/prysm/BUILD.bazel", line 78
                nogo(name = 'nogo')
        File "/home/preston/.cache/bazel/_bazel_preston/2bf51e8690558a83a0a0514ab422fd4b/external/io_bazel_rules_go/go/private/rules/nogo.bzl", line 78, in _nogo_impl
                go.binary(go, name = ctx.label.name, source = ...)
        File "/home/preston/.cache/bazel/_bazel_preston/2bf51e8690558a83a0a0514ab422fd4b/external/io_bazel_rules_go/go/private/actions/binary.bzl", line 52, in go.binary
                go.link(go, archive = archive, test_archives..., <4 more arguments>)
        File "/home/preston/.cache/bazel/_bazel_preston/2bf51e8690558a83a0a0514ab422fd4b/external/io_bazel_rules_go/go/private/actions/link.bzl", line 156, in go.link
                inputs_direct.append(go.coverdata.data.file)
        File "/home/preston/.cache/bazel/_bazel_preston/2bf51e8690558a83a0a0514ab422fd4b/external/io_bazel_rules_go/go/private/actions/link.bzl", line 156, in inputs_direct.append
                go.coverdata.data
object of type 'NoneType' has no field 'data'
jayconrod pushed a commit to jayconrod/rules_go that referenced this issue Jul 16, 2019
emit_link was referencing go.coverdata.data when go.coverage_enabled
was true but go.coverdata was None. This is the case for nogo, since
nogo binaries don't have an implicit reference on coverdata.

Fixes bazel-contrib#2146
@jayconrod
Copy link
Contributor

Thanks for reporting. #2148 should fix this.

Please use the issue template in the future though. It makes it much easier to understand how the problem occurred and how to reproduce it.

@prestonvanloon
Copy link
Contributor Author

Thanks, will do.

jayconrod pushed a commit that referenced this issue Jul 16, 2019
emit_link was referencing go.coverdata.data when go.coverage_enabled
was true but go.coverdata was None. This is the case for nogo, since
nogo binaries don't have an implicit reference on coverdata.

Fixes #2146
jayconrod pushed a commit that referenced this issue Jul 19, 2019
emit_link was referencing go.coverdata.data when go.coverage_enabled
was true but go.coverdata was None. This is the case for nogo, since
nogo binaries don't have an implicit reference on coverdata.

Fixes #2146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants