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: go get ./... loops infinitely with specific go.mod, go.sum #52508

Open
arbourd opened this issue Apr 22, 2022 · 1 comment
Open

cmd/go: go get ./... loops infinitely with specific go.mod, go.sum #52508

arbourd opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
GoCommand modules NeedsInvestigation
Milestone

Comments

@arbourd
Copy link

@arbourd arbourd commented Apr 22, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18.1 darwin/arm64

Does this issue reproduce with the latest release?

Yes, built from source on master and latest release.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="auto"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/dylan/Library/Caches/go-build"
GOENV="/Users/dylan/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/dylan/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/dylan/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18.1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.1/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/dylan/src/github.com/arbourd/test-go-broke/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xz/1jqk4k092tv32h4b0v53wym00000gn/T/go-build1295850106=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Runing go get ./... on a specific go.sum and go.mod which I have provided here: https://github.com/arbourd/test-go-broke/tree/ac80f1816b6fa7b6ca7509c3e2fcf2f502003d19

What did you expect to see?

go get ./... to resolve packages or an error.

What did you see instead?

Command will hang indefinitely.

Some sleuthing

The infinite loop seems to have origins here: https://github.com/golang/go/blob/go1.18.1/src/cmd/go/internal/modget/get.go#L350-L353

I built my own go binary with some fmt.Println, and it seems that changed is always true.

// Upgrades variable will always return this first
// [{github.com/suborbital/sat [{github.com/suborbital/sat v0.1.2}] { } <nil>} {github.com/suborbital/subo [{github.com/suborbital/subo v0.4.2}] { } <nil>}]
// The second iteration will return
// []
// and the cycle will repeat infinitely
upgrades := r.findAndUpgradeImports(ctx, queries)
if changed := r.applyUpgrades(ctx, upgrades); changed {
	// This will always be true
	continue
}
@thepudds
Copy link

@thepudds thepudds commented Apr 22, 2022

@bcmills bcmills self-assigned this Apr 23, 2022
@bcmills bcmills added NeedsInvestigation modules labels Apr 23, 2022
@bcmills bcmills added this to the Go1.19 milestone Apr 23, 2022
@bcmills bcmills added the GoCommand label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand modules NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants