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: clarify the impact of the -tags flag on test/build caching #29782

Open
kortschak opened this issue Jan 17, 2019 · 2 comments

Comments

@kortschak
Copy link
Contributor

commented Jan 17, 2019

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

$ go version
go version devel +4b3f04c

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
GOARCH="amd64"
GOBIN=""
GOCACHE="~/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="~"
GOPROXY=""
GORACE=""
GOROOT="~/go"
GOTMPDIR=""
GOTOOLDIR="~/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build224479533=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Read the documentation for build/test caching from go help test. Then

$ go test -tags noasm gonum.org/v1/gonum/mat
ok  	gonum.org/v1/gonum/mat	44.695s
$ go test -tags noasm gonum.org/v1/gonum/mat
ok  	gonum.org/v1/gonum/mat	(cached)

From this it's clear that -tags is not counted in test flags (and this is reasonably given the wording).

What did you expect to see?

No caching.

What did you see instead?

Happily, caching.

While the wording is consistent with the apparent intended meaning, it could be made clearer that build flags do not impact on caching for tests (if this is true - I could find no mention of caching in go help build or go help install or mention of which flags prevent caching (other than -a in go help cache)).

@bcmills bcmills added this to the Go1.13 milestone Jan 22, 2019

@christopherdiehl

This comment has been minimized.

Copy link

commented Feb 3, 2019

If no one is working on this, I can take a go updating the ‘go help build’ and ‘go help install’ documentation. Please let me know if it makes sense to update any other help commands output.

@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 18, 2019

@christopherdiehl, you're welcome to take this if you like.

The paragraph about test caching and uncacheable flags is here, and probably the fix is to clarify that all build flags are cacheable.

@bcmills bcmills added the help wanted label Sep 18, 2019

@bcmills bcmills modified the milestones: Go1.14, Unplanned Sep 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.