]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make build -a skip standard packages in Go releases
authorRuss Cox <rsc@golang.org>
Fri, 26 Sep 2014 18:41:26 +0000 (14:41 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 26 Sep 2014 18:41:26 +0000 (14:41 -0400)
commit8c3005c4929e26cba74c80703123e150fa3fda1a
tree02e67fa924579e18dba873a78296bff1c4bcd4bf
parente5afecbd0e2253fb5f1be0aa6f6cbb5c00676e42
cmd/go: make build -a skip standard packages in Go releases

Today, 'go build -a my/pkg' and 'go install -a my/pkg'
recompile not just my/pkg and all its dependencies that
you wrote but also the standard library packages.
Recompiling the standard library is problematic on
some systems because the installed copy is not writable.

The -a behavior means that you can't use 'go install -a all'
or 'go install -a my/...' to rebuild everything after a Go
release - the rebuild stops early when it cannot overwrite
the installed standard library.

During development work, however, you do want install -a
to rebuild everything, because anything might have changed.

Resolve the conflict by making the behavior of -a depend
on whether we are using a released copy of Go or a devel copy.
In the release copies, -a no longer applies to the standard library.
In the devel copies, it still does.

This is the latest in a long line of refinements to the
"do I build this or not" logic. It is surely not the last.

Fixes #8290.

LGTM=r
R=golang-codereviews, r, tracey.brendan
CC=adg, golang-codereviews, iant
https://golang.org/cl/151730045
src/cmd/go/build.go
src/cmd/go/doc.go
src/cmd/go/pkg.go
src/cmd/go/test.bash
src/cmd/go/testgo.go [new file with mode: 0644]