Skip to content

Commit 8096433

Browse files
committed
cmd/dist: set GOPROXY=off when GOPATH is set to be in GOROOT
Avoid downloading modules into a modcache in the GOROOT directory. That creates read only files in GOROOT, which is undesirable. Fixes #67463 Change-Id: I6d10c605be5eba967648d823ee8fc915716b4b5b Reviewed-on: https://go-review.googlesource.com/c/go/+/586078 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent fd54936 commit 8096433

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/dist/build.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,12 @@ func cmdbootstrap() {
13941394
// go tool may complain.
13951395
os.Setenv("GOPATH", pathf("%s/pkg/obj/gopath", goroot))
13961396

1397+
// Set GOPROXY=off to avoid downloading modules to the modcache in
1398+
// the GOPATH set above to be inside GOROOT. The modcache is read
1399+
// only so if we downloaded to the modcache, we'd create readonly
1400+
// files in GOROOT, which is undesirable. See #67463)
1401+
os.Setenv("GOPROXY", "off")
1402+
13971403
// Use a build cache separate from the default user one.
13981404
// Also one that will be wiped out during startup, so that
13991405
// make.bash really does start from a clean slate.

0 commit comments

Comments
 (0)