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

cmd/go: covermode always results in build ID mismatch #68319

Closed
rittneje opened this issue Jul 5, 2024 · 3 comments
Closed

cmd/go: covermode always results in build ID mismatch #68319

rittneje opened this issue Jul 5, 2024 · 3 comments
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@rittneje
Copy link

rittneje commented Jul 5, 2024

Go version

go version go1.22.4 linux/amd64

Output of go env in your module/workspace:

GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/tmp/.gocache'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY='<redacted>'
GONOSUMDB='<redacted>'
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE='<redacted>'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS='<redacted>'
GOVERSION='go1.22.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD=''
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4162348479=/tmp/go-build -gno-record-gcc-switches'

What did you do?

First I pre-compiled the standard library with -trimpath and -covermode.

go build -trimpath -covermode=atomic std

Then I asked whether the net package was stale.

go list -f '{{.Stale}} {{.StaleReason}}' -trimpath -covermode=atomic net

What did you see happen?

true build ID mismatch

What did you expect to see?

false

Note that it works as expected without -covermode.

@thanm thanm self-assigned this Jul 7, 2024
@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 7, 2024
@thanm
Copy link
Contributor

thanm commented Jul 7, 2024

Thanks for the report. I will take a look later this week.

@thanm
Copy link
Contributor

thanm commented Jul 8, 2024

Hi @rittneje , it appears that this problem is already fixed on tip, and will be present in 1.23. The fix CL is https://go-review.googlesource.com/c/go/+/560236. It also looks as though that fix is going to be back-ported to 1.22, so in theory if you update to Go 1.22.6 when it rolls out in August, that should take care of it. Thanks.

@thanm thanm closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants