]> Cypherpunks repositories - gostls13.git/commit
cmd/go: extract module zip files in place
authorJay Conrod <jayconrod@google.com>
Tue, 25 Feb 2020 16:00:08 +0000 (11:00 -0500)
committerJay Conrod <jayconrod@google.com>
Wed, 11 Mar 2020 17:31:14 +0000 (17:31 +0000)
commit576fa692774137633b09dd244e1de36993dd2803
tree611c233ac7c050e802f0d3d82e4590a9337548db
parent093049b3709eda7537ece92a2991918cf53782d6
cmd/go: extract module zip files in place

Previously, we extracted module zip files to temporary directories
with random names, then renamed them to their final locations. This
failed with ERROR_ACCESS_DENIED on Windows if any file in the
temporary was open. Antivirus programs did this occasionally. Retrying
the rename did not work (CL 220978).

With this change, we extract module zip files in place. We create a
.partial file alongside the .lock file to indicate a directory is not
fully populated, and we delete this at the end of the process.

Updates #36568

Change-Id: I75c09df879a602841f3459322c021896292b2fdb
Reviewed-on: https://go-review.googlesource.com/c/go/+/221157
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/script_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/mod_concurrent_unzipinplace.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_download_concurrent_read.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_download_partial.txt