diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2019-03-25 21:36:31 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-03-25 22:11:58 +0000 |
| commit | e6df1799791fac7262effe4464bd5c82bbb275cb (patch) | |
| tree | e7c26067cb75139b536c2976e2da5557cc95bc8e /src | |
| parent | 50fe9461eb551d3df340c36fb3f24f9faf461422 (diff) | |
| download | go-e6df1799791fac7262effe4464bd5c82bbb275cb.tar.xz | |
cmd/dist: move GOPATH setting from init to bootstrap
CL 168697 unconditionally set GOPATH in dist, which broke the
misc-vet-vetall builder, because cmd/vet/all depends on GOPATH.
Fixes #30971
Change-Id: If6a58e054c6a4fedc2ea506a2c443348489c91f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/169217
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/dist/build.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index b724d16456..e5d4b2458a 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -235,13 +235,6 @@ func xinit() { // make.bash really does start from a clean slate. os.Setenv("GOCACHE", pathf("%s/pkg/obj/go-build", goroot)) - // Set GOPATH to an internal directory. We shouldn't actually - // need to store files here, since the toolchain won't - // depend on modules outside of vendor directories, but if - // GOPATH points somewhere else (e.g., to GOROOT), the - // go tool may complain. - os.Setenv("GOPATH", pathf("%s/pkg/obj/gopath", goroot)) - // Make the environment more predictable. os.Setenv("LANG", "C") os.Setenv("LANGUAGE", "en_US.UTF8") @@ -1211,6 +1204,13 @@ func cmdbootstrap() { xflagparse(0) + // Set GOPATH to an internal directory. We shouldn't actually + // need to store files here, since the toolchain won't + // depend on modules outside of vendor directories, but if + // GOPATH points somewhere else (e.g., to GOROOT), the + // go tool may complain. + os.Setenv("GOPATH", pathf("%s/pkg/obj/gopath", goroot)) + if debug { // cmd/buildid is used in debug mode. toolchain = append(toolchain, "cmd/buildid") |
