Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: 'go get' does not add missing hash to go.sum when ziphash file missing from cache [1.15 backport] #44872

Closed
jayconrod opened this issue Mar 8, 2021 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@jayconrod
Copy link
Contributor

I'm requesting that the fix for #44749 be backported to Go 1.15.

The problem affects both 1.15 and 1.16, though it is less noticeable on 1.15. I expect the fix to apply cleanly to 1.15, perhaps with a small change to the regression test.

(Manually created this issue due to #25574).

@jayconrod jayconrod added the CherryPickCandidate Used during the release process for point releases label Mar 8, 2021
@jayconrod jayconrod added this to the Go1.15.9 milestone Mar 8, 2021
@gopherbot
Copy link

Change https://golang.org/cl/299830 mentions this issue: [release-branch.go1.15] cmd/go/internal/modfetch: detect and recover from missing ziphash file

@toothrot toothrot modified the milestones: Go1.15.9, Go1.15.10 Mar 10, 2021
@cagedmantis cagedmantis modified the milestones: Go1.15.10, Go1.15.11 Mar 11, 2021
@dmitshur
Copy link
Contributor

Approving per discussion in a release meeting. This backport applies to both 1.16 (#44812) and 1.15 (this issue).

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Mar 12, 2021
@gopherbot
Copy link

Closed by merging 7038a38 to release-branch.go1.15.

gopherbot pushed a commit that referenced this issue Mar 25, 2021
…from missing ziphash file

Previously, if an extracted module directory existed in the module
cache, but the corresponding ziphash file did not, if the sum was
missing from go.sum, we would not verify the sum. This caused 'go get'
not to write missing sums. 'go build' in readonly mode (now the
default) checks for missing sums and doesn't attempt to fetch modules
that can't be verified against go.sum.

With this change, when requesting the module directory with
modfetch.DownloadDir, if the ziphash file is missing, the go command
will re-hash the zip without downloading or re-extracting it again.

Note that the go command creates the ziphash file before the module
directory, but another program could remove it separately, and it
might not be present after a crash.

Fixes #44872

Change-Id: I64551e048a3ba17d069de1ec123d5b8b2757543c
Reviewed-on: https://go-review.googlesource.com/c/go/+/298352
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>
(cherry picked from commit 302a400)
Reviewed-on: https://go-review.googlesource.com/c/go/+/299830
@golang golang locked and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

6 participants