]> Cypherpunks repositories - gostls13.git/commit
cmd/go: adjust default GOROOT to prefer runtime.GOROOT() spelling
authorRuss Cox <rsc@golang.org>
Sat, 28 Oct 2017 18:23:21 +0000 (14:23 -0400)
committerRuss Cox <rsc@golang.org>
Sun, 29 Oct 2017 23:37:34 +0000 (23:37 +0000)
commiteac6fe082ba0e54b387eca7604811958fe62a094
treec92b679252407f1ef55c59fe15afe1f198c42ecd
parent164e1b84777082d83d659a16fad8e1d0456a8638
cmd/go: adjust default GOROOT to prefer runtime.GOROOT() spelling

If runtime.GOROOT() and the os.Executable method for finding GOROOT
find the same directory but with different spellings, prefer the spelling
returned by runtime.GOROOT().

This avoids an inconsistency if "pwd" returns one spelling but a
different spelling is used in $PATH (and therefore in os.Executable()).
make.bash runs with GOROOT=$(cd .. && pwd); the goal is to allow
the resulting toolchain to use that default setting (unless moved)
even if the directory spelling is different in $PATH.

Change-Id: If96b28b9e8697f4888f153a400b40bbf58a9128b
Reviewed-on: https://go-review.googlesource.com/74250
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/go/internal/cfg/cfg.go