Description
What version of Go are you using (go version
)?
$ go version go version go1.17.2 linux/arm # in a build container based on debian stretch
Does this issue reproduce with the latest release?
untested
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="arm" GOBIN="" GOCACHE="/builds/r/rcnode/.gocache-arm/go-build" GOENV="/root/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/builds/r/rcnode/.gomodcache-arm/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/builds/r/rcnode/.go-arm" GOPRIVATE="" GOPROXY="https://goproxy.io,https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm" GOVCS="" GOVERSION="go1.17.2" GCCGO="gccgo" GOARM="6" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3509342896=/tmp/go-build -gno-record-gcc-switches"
(Note the directories are in a container, and /builds
is mounted into it from the project dir.)
What did you do?
I built a program with a largish number of dependencies.
The build consistently fails during getting these with go get -v -u ./...
, notably mostly on
cloud.google.com/go/storage@v1.14.0: Get "https://goproxy.io/cloud.google.com/go/storage/@v/v1.14.0.mod": net/http: TLS handshake timeout
and
pkg/config/config.go:12:2: gopkg.in/yaml.v2@v2.2.1: Get "https://goproxy.io/gopkg.in/yaml.v2/@v/v2.2.1.zip": net/http: TLS handshake timeout
It is suspicious that this only happens with arm32
builds (likely only with with CGO=1
), and it can indeed be seen that the qemu
container process has a high load before go get
fails.
My suspicion is that go get
can't find a binary package for arm32
arch and starts building it automatically, which is of course good and expected behaviour. However: it seems that go get
wrongly applies a networking timeout to this situation, where it should handle package builds from source with a different timeout (these usually take much longer, especially under qemu
, which should be allowed).
What did you expect to see?
A successful build, independent of architecture. (As a reference: other non-native builds, e.g. arm64
, in a container which is built in the same way except for the arch, do not have this issue, but they are also significantly faster, which leads to the suspicion that the issue is indeed the application of an unreasonable timeout).
What did you see instead?
Networking timeouts during go get
, where the bottleneck appears to be not the network but a local package build (high processor load).