]> Cypherpunks repositories - gostls13.git/commit
cmd/go: explicitly reject overlays affecting GOMODCACHE
authorMichael Matloob <matloob@golang.org>
Tue, 18 Feb 2025 20:31:14 +0000 (15:31 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2025 19:26:45 +0000 (11:26 -0800)
commit3f46587fe05f745a0bf91b74c2834f1317acba24
treecaf31ddaf94e7d75055812b0d9015c797b9d0819
parent3c05790d4847ba2d0d06b5ba3f82b311a99d531c
cmd/go: explicitly reject overlays affecting GOMODCACHE

The go command assumes that GOMODCACHE is immutable. As an example of
one place the assumption is made, the modindex won't stat the files in
GOMODCACHE when getting the cache key for the index entry and just uses
the path of the module in the modcache (basically the module's name and
version). Explicitly reject overlays affecting GOMODCACHE to avoid
surprising and incorrect behavior.

For #71783
For #71075

Change-Id: I21dd5d39d71037de473b09ac8482a1867864e11f
Reviewed-on: https://go-review.googlesource.com/c/go/+/650475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/fsys/fsys.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/init.go