]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: always extract module directories in place
authorJay Conrod <jayconrod@google.com>
Thu, 1 Oct 2020 17:37:06 +0000 (13:37 -0400)
committerJay Conrod <jayconrod@google.com>
Thu, 1 Oct 2020 21:06:35 +0000 (21:06 +0000)
commit507a88c39bb1089b9d44facb7dd3449a9b5a3e10
tree2a6637ea4740a6ab16ee5e3e1ea8b0a78d9e1a63
parentf4cbf3477f1456b4d28a7b74b31820ee60b7e6d1
cmd/go/internal/modfetch: always extract module directories in place

Previously by default, we extracted modules to a temporary directory,
then renamed it into place. This failed with ERROR_ACCESS_DENIED on
Windows if another process (usually an anti-virus scanner) opened
files in the temporary directory.

Since Go 1.15, users have been able to set
GODEBUG=modcacheunzipinplace=1 to opt into new behavior: we extract
modules at their final location, and we create and later delete a
.partial file to prevent the directory from being used if we crash.
.partial files are recognized by Go 1.14.2 and later.

With this change, the new behavior is the only behavior.
modcacheunzipinplace is no longer recognized.

Fixes #36568

Change-Id: Iff19fca5cd6eaa3597975a69fa05c4cb1b834bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/258798
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/testdata/script/mod_concurrent_unzipinplace.txt [deleted file]
src/cmd/go/testdata/script/mod_download_concurrent_read.txt
src/cmd/go/testdata/script/mod_download_partial.txt