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: emit a log after all module downloads complete #39728

Open
zombiezen opened this issue Jun 20, 2020 · 2 comments
Open

cmd/go: emit a log after all module downloads complete #39728

zombiezen opened this issue Jun 20, 2020 · 2 comments
Milestone

Comments

@zombiezen
Copy link
Contributor

@zombiezen zombiezen commented Jun 20, 2020

It's great that in steady state, go build produces no output on success. However, the lack of feedback as to when go build has finished downloading all its dependencies makes it hard to diagnose whether a long invocation of go build is due to compilation or a network issue. This can be especially important in a CI environment where there is often no cache. While it's possible to run go build with -x or -v to get this information, it's often much more information than is needed.

The behavior I would like to see is that if go build downloads any modules, it prints a log line at the end of the download phase to indicate that the downloads have finished and the build has started. If go build does not download any modules, it would not output anything new.

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

$ go version
go version go1.14.4 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/light/.cache/go-build"
GOENV="/home/light/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOOS="linux"
GOPATH="/home/light"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build668438767=/tmp/go-build -gno-record-gcc-switches"

What did you do?

export GO111MODULE=on
go clean -modcache
go get golang.org/x/tools/gopls # or any random tool to build

What did you expect to see?

go: downloading golang.org/x/tools/gopls v0.4.1
go: downloading golang.org/x/tools v0.0.0-20200619210111-0f592d2728bb
go: golang.org/x/tools/gopls upgrade => v0.4.1
go: downloading golang.org/x/tools v0.0.0-20200513154647-78b527d18275
go: downloading honnef.co/go/tools v0.0.1-2020.1.3
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading mvdan.cc/xurls/v2 v2.1.0
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: downloading golang.org/x/mod v0.2.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloads complete

The last line is what I'd like. Phrasing is totally up for debate.

What did you see instead?

A lot of downloading lines, followed by a pause.

go: downloading golang.org/x/tools/gopls v0.4.1
go: downloading golang.org/x/tools v0.0.0-20200619210111-0f592d2728bb
go: golang.org/x/tools/gopls upgrade => v0.4.1
go: downloading golang.org/x/tools v0.0.0-20200513154647-78b527d18275
go: downloading honnef.co/go/tools v0.0.1-2020.1.3
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading mvdan.cc/xurls/v2 v2.1.0
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: downloading golang.org/x/mod v0.2.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: downloading github.com/BurntSushi/toml v0.3.1
@cagedmantis cagedmantis added this to the Unplanned milestone Jun 22, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jun 22, 2020

@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Jun 23, 2020

Related #26152.

Seems useful. The go command isn't currently very good about communicating progress, and this would help.

@jayconrod jayconrod modified the milestones: Unplanned, Backlog Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.