-
-
Notifications
You must be signed in to change notification settings - Fork 662
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(rules/compilepkg): cgo2 is invoked _twice_ when using coverage instrumentation #4110
Comments
As the title suggests,
Luckily, the above still compiles since the second call to [1] https://github.com/bazelbuild/rules_go/blob/8b8294b6359a9c0a89af968fb7092f6e7194f420/go/tools/builders/compilepkg.go#L312 |
In [1], a regression was added in `exclude_files` for the `unconvert` linter. This regression only affects builds instrumented with coverage; see [2] for further details. As a workaround for [2], we extend `exclude_files` to exclude Go sources generated from protobuf, having the optional suffix of the form `_[0-9]+`. [1] cockroachdb#124155 [2] bazel-contrib/rules_go#4110 Epic: none Release note: None
There have been quite a lot of changes to nogo since 0.46.0. Could you check whether 0.50.1 fixes this? If not, a PR would be very welcome. |
130993: nogo: fix unconvert exclude rules r=vidit-bhat,nameisbhaskar a=srosenberg In [1], a regression was added in `exclude_files` for the `unconvert` linter. This regression only affects builds instrumented with coverage; see [2] for further details. As a workaround for [2], we extend `exclude_files` to exclude Go sources generated from protobuf, having the optional suffix of the form `_[0-9]+`. [1] #124155 [2] bazel-contrib/rules_go#4110 Epic: none Release note: None Co-authored-by: Stan Rosenberg <[email protected]>
What version of rules_go are you using?
upstream release-0.46 (https://github.com/cockroachdb/rules_go/commits/release-0.46/) plus a few patches
What version of gazelle are you using?
v0.33.0-0-g061cc37
What version of Bazel are you using?
7.2.1
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
Linux x86_64
Any other potentially useful information about your toolchain?
What did you do?
Attempted to build a Go package (from CockroachDB) with coverage instrumentation,
The build failed due to
nogo
,Removing
--collect_code_coverage
from the above yields a successful build,What did you expect to see?
I expected the build to succeed when using
--collect_code_coverage
.What did you see instead?
Instead, the build failed for a rather obscure reason (see below).
The text was updated successfully, but these errors were encountered: