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
cmd/go: list with -export and -covermode=atomic fails to build #65264
Comments
The call chain is via: So the question is: is this a typestate bug (with the error happening before the call to (attn @thanm) |
My very hazy understanding is that it's an issue in runList:
This needs to happen before Locally, I was able to get the repro command to work by calling
|
In triage, I think we're waiting for @thanm to take a look. Don't mean to assign you work though, so feel free to comment and unassign. Thanks! :) |
Change https://go.dev/cl/560236 mentions this issue: |
I tried my hand at submitting a patch. It's quite small. Happy to take direction if my CL is incomplete or incorrect, or else close it and get out of the way to let a maintainer handle it. 😅 |
When -covermode is set to atomic, instrumented packages need to import sync/atomic. If this is not already imported by a package being instrumented, the build needs to ensure that sync/atomic is compiled whenever 'go list' is run in a way that triggers package builds. The build config was already being made to ensure the import, but only after the action graph had been created, so there was no guarantee that sync/atomic would be built when needed. Fixes golang#65264. Change-Id: Ib3f1e102ce2ef554ea08330d9db69a8c98790ac5 Reviewed-on: https://go-review.googlesource.com/c/go/+/560236 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Go version
go version go1.21.6 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
What did you expect to see?
go build -cover -race
works as expected. We would expect thego list
command to succeed as well.When running
go list ...
with-work
, we can seesync/atomic
is correctly added to the*.cover.go
files, but it is not included inimportcfg
:The text was updated successfully, but these errors were encountered: