]> Cypherpunks repositories - gostls13.git/commit
cmd/go: don't lock .mod and .sum files for read in overlay
authorJay Conrod <jayconrod@google.com>
Tue, 6 Jul 2021 17:38:18 +0000 (10:38 -0700)
committerJay Conrod <jayconrod@google.com>
Wed, 7 Jul 2021 21:57:42 +0000 (21:57 +0000)
commit991fd381d52e7cec37ab54732613d3e465916206
tree7d6a864a7833440be65afc448072dc10b535bc1c
parent186a3bb4b0939837c855a4f0689d4a4401aff608
cmd/go: don't lock .mod and .sum files for read in overlay

On Plan 9, locking a file requires a chmod call. In general, the go
command should not modify files in the overlay, even metadata. With
this change, we won't lock these files for reading.

The go command already reported errors when attempting to write these
files if they were in the overlay, but this change moves those checks
to the point of access for clearer error
messages. cmd/go/internal/lockedfile no longer imports
cmd/go/internal/fsys.

Fixes #44700

Change-Id: Ib544459dd6cf56ca0f7a27b3285f045f08040d7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/333012
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/lockedfile/lockedfile_filelock.go
src/cmd/go/internal/lockedfile/lockedfile_plan9.go
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/testdata/script/mod_overlay.txt