1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:44:45 -07:00
go/src
Russ Cox 8f70e1f8a9 cmd/go: do not install dependencies during "go install"
This CL makes "go install" behave the way many users expect:
install only the things named on the command line.
Future builds still run as fast, thanks to the new build cache (CL 75473).
To install dependencies as well (the old behavior), use "go install -i".

Actual definitions aside, what most users know and expect of "go install"
is that (1) it installs what you asked, and (2) it's fast, unlike "go build".
It was fast because it installed dependencies, but installing dependencies
confused users repeatedly (see for example #5065, #6424, #10998, #12329,
"go build" and "go test" so that they could be "fast" too, but that only
created new opportunities for confusion. We also had to add -installsuffix
and then -pkgdir, to allow "fast" even when dependencies could not be
installed in the usual place.

The recent introduction of precise content-based staleness logic means that
the go command detects the need for rebuilding packages more often than it
used to, with the consequence that "go install" rebuilds and reinstalls
dependencies more than it used to. This will create more new opportunities
for confusion and will certainly lead to more issues filed like the ones
listed above.

CL 75743 introduced a build cache, separate from the install locations.
That cache makes all operations equally incremental and fast, whether or
not the operation is "install" or "build", and whether or not "-i" is used.

Installing dependencies is no longer necessary for speed, it has confused
users in the past, and the more accurate rebuilds mean that it will confuse
users even more often in the future. This CL aims to end all that confusion
by not installing dependencies by default.

By analogy with "go build -i" and "go test -i", which still install
dependencies, this CL introduces "go install -i", which installs
dependencies in addition to the things named on the command line.

Fixes #5065.
Fixes #6424.
Fixes #10998.
Fixes #12329.
Fixes #18981.
Fixes #22469.

Another step toward #4719.

Change-Id: I3d7bc145c3a680e2f26416e182fa0dcf1e2a15e5
Reviewed-on: https://go-review.googlesource.com/75850
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-11-03 22:09:46 +00:00
..
archive archive/zip, crypto/tls: use rand.Read instead of casting ints to bytes 2017-11-01 05:51:30 +00:00
bufio bufio: add Reader.Size and Writer.Size accessors 2017-11-02 17:17:44 +00:00
builtin builtin: use type aliases for rune and byte 2017-06-07 00:42:59 +00:00
bytes bytes: set cap of slices returned by Split and Fields and friends 2017-11-03 19:06:15 +00:00
cmd cmd/go: do not install dependencies during "go install" 2017-11-03 22:09:46 +00:00
compress
container
context
crypto crypto, hash: implement BinaryMarshaler, BinaryUnmarshaler in hash implementations 2017-11-01 21:04:12 +00:00
database/sql
debug
encoding cmd/compile: add rules to improve consecutive byte loads and stores on ppc64le 2017-11-03 18:46:59 +00:00
errors
expvar
flag
fmt fmt: hide bad format in test from vet 2017-10-31 13:49:53 +00:00
go go/types: add missing documentation to Object factory functions 2017-11-03 20:03:04 +00:00
hash go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
html
image go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
index/suffixarray
internal cmd/link: restore windows stack commit size back to 4KB 2017-11-03 00:09:40 +00:00
io io: fix Pipe regression with differing error types 2017-11-02 23:05:53 +00:00
log
math math/bits: add examples for right rotation 2017-11-03 20:12:07 +00:00
mime all: unindent some if bodies by exiting early 2017-10-31 20:07:46 +00:00
net net/http: clarify when it is safe to reuse a request 2017-11-02 23:51:25 +00:00
os cmd/go: run vet automatically during go test 2017-11-03 22:09:38 +00:00
path
plugin cmd/link, plugin: always encode path 2017-10-26 15:08:37 +00:00
reflect all: unindent some if bodies by exiting early 2017-10-31 20:07:46 +00:00
regexp go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
runtime cmd/go: run vet automatically during go test 2017-11-03 22:09:38 +00:00
sort sort: split post-Go1.4 code into its own file 2017-10-27 16:01:43 +00:00
strconv
strings strings: add examples for specialCase 2017-10-31 14:09:07 +00:00
sync sync/atomic: add memory barriers to Load/StoreInt32 on darwin/arm 2017-10-02 09:57:23 +00:00
syscall go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
testing testing/iotest: fix NewReadLogger documentation typo 2017-10-19 15:59:21 +00:00
text all: unindent some if bodies by exiting early 2017-10-31 20:07:46 +00:00
time go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
unicode go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
unsafe all: remove some double spaces from comments 2017-08-26 15:09:09 +00:00
vendor/golang_org/x vendor/golang_org/x/net/idna: update from upstream 2017-11-02 17:08:27 +00:00
all.bash
all.bat
all.rc build: do not set GOBIN on Plan 9 2013-02-26 09:25:46 -08:00
androidtest.bash androidtest.bash: use go list to get pkg dir 2016-08-29 15:24:39 +00:00
bootstrap.bash
buildall.bash
clean.bash
clean.bat build: fix clean scripts 2015-06-18 16:13:13 +00:00
clean.rc
cmp.bash
iostest.bash
make.bash cmd/dist: fix bad LC_TIME assumption in 'date' invocation 2017-11-03 13:42:33 +00:00
make.bat
Make.dist
make.rc build: quiet make.bash, make.bat, make.rc 2017-10-31 13:48:53 +00:00
naclmake.bash src: split nacltest.bash into naclmake.bash and keep nacltest.bash 2016-04-12 02:03:34 +00:00
nacltest.bash
race.bash
race.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bash
run.bat
run.rc