mirror of https://github.com/golang/go.git
cmd/go: assume that code in $GOROOT is up to date
Do not check compiler/linker timestamps for packages that are in the $GOROOT. Avoids trying to rebuild non-writable standard packages when timestamps have not been retained on the Go binaries. Fixes #4106. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6533053
This commit is contained in:
parent
ded94b7222
commit
e80fccb441
|
|
@ -521,14 +521,19 @@ func isStale(p *Package, topRoot map[string]bool) bool {
|
||||||
// As a courtesy to developers installing new versions of the compiler
|
// As a courtesy to developers installing new versions of the compiler
|
||||||
// frequently, define that packages are stale if they are
|
// frequently, define that packages are stale if they are
|
||||||
// older than the compiler, and commands if they are older than
|
// older than the compiler, and commands if they are older than
|
||||||
// the linker. This heuristic will not work if the binaries are back-dated,
|
// the linker. This heuristic will not work if the binaries are
|
||||||
// as some binary distributions may do, but it does handle a very
|
// back-dated, as some binary distributions may do, but it does handle
|
||||||
// common case. See issue 3036.
|
// a very common case.
|
||||||
if olderThan(buildToolchain.compiler()) {
|
// See issue 3036.
|
||||||
return true
|
// Assume code in $GOROOT is up to date, since it may not be writeable.
|
||||||
}
|
// See issue 4106.
|
||||||
if p.build.IsCommand() && olderThan(buildToolchain.linker()) {
|
if p.Root != goroot {
|
||||||
return true
|
if olderThan(buildToolchain.compiler()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if p.build.IsCommand() && olderThan(buildToolchain.linker()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Have installed copy, probably built using current compilers,
|
// Have installed copy, probably built using current compilers,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue