Skip to content

x/exp/cmd/gorelease: unexpected go.sum complaint #70354

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

Closed
kramvan1 opened this issue Nov 14, 2024 · 8 comments
Closed

x/exp/cmd/gorelease: unexpected go.sum complaint #70354

kramvan1 opened this issue Nov 14, 2024 · 8 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@kramvan1
Copy link

Go version

go 1.22.9 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/me/Library/Caches/go-build'
GOENV='/Users/me/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/me/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/me/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go@1.22/1.22.9/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/homebrew/Cellar/go@1.22/1.22.9/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.9'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/me/go/src/.../go.mod'
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/_4/psrhrty902b4x_gbdfgv8pgh0000gn/T/go-build2882118008=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

gorelease
using latest version v0.0.0-20241009180824-f66d83c29e7c

What did you see happen?

diagnostics

go.sum: one or more sums are missing. Run 'go mod tidy' to add missing sums.

What did you expect to see?

No issues with go.sum, as running go mod tidy makes NO difference here.

This was reported before with #64051
Seems like a good bug to me.

This is against a private internal repo, so can share anything about that.

@gopherbot gopherbot added this to the Unreleased milestone Nov 14, 2024
@timothy-king
Copy link
Contributor

This is against a private internal repo, so can share anything about that.

More information would really help for progress on this. Like a minimized reproducer or an anonymized go.sum file could really help. The contents of the variables in the gorelease.go line:

		if !sumsMatchIgnoringPath(string(goSumData), string(newGoSumData), modPath) {

would also be useful.

@timothy-king timothy-king added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 14, 2024
@kramvan1
Copy link
Author

@timothy-king How to produce the info you need, anonymized go.sum?
Not sure I follow the contents of the variables in the gorelease.go, do you mean to bring that up in the debugger and see what those vars are?

@timothy-king
Copy link
Contributor

I would just printf those values when the diagnostic is being created. But debugger also works. Hopefully those lines will tell us something interesting about what the failure is and hint at the next steps to take.

Right now all we really know is that this line is being reached. I am hoping to try to work backwards from that.

@kramvan1
Copy link
Author

kramvan1 commented Nov 20, 2024

@timothy-king Looks like this is related to the go.mod having a directive like this:
replace github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.5.1

for this requirement:
require github.com/golang-jwt/jwt/v4 v4.5.1 // indirect

The diff in the go.sum file is:
github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=

It's pulling in the unwanted jwt version in the go replace case.

Added this to gorelease.go to make easy to debug, in case you want to add something like that for future debugging.

		if !sumsMatchIgnoringPath(string(goSumData), string(newGoSumData), modPath) {
			diagnostics = append(diagnostics, "go.sum: one or more sums are missing. Run 'go mod tidy' to add missing sums.")
			diagnostics = append(diagnostics, "goSumData")
			diagnostics = append(diagnostics, string(goSumData))
			diagnostics = append(diagnostics, "newGoSumData")
			diagnostics = append(diagnostics, string(newGoSumData))
			diagnostics = append(diagnostics, "modPath")
			diagnostics = append(diagnostics, modPath)
		}

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 14, 2024
@kramvan1
Copy link
Author

@seankhliao What other info are you waiting for, seems like obvious bug in the code related to the replace directive.

@seankhliao
Copy link
Member

I don't think that's sufficient information for us to reproduce or identify the issue.

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 28, 2024
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants