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 mod download needs to support toolchain upgrades #62054

Closed
bcmills opened this issue Aug 15, 2023 · 6 comments
Closed

cmd/go: go mod download needs to support toolchain upgrades #62054

bcmills opened this issue Aug 15, 2023 · 6 comments
Assignees
Labels
GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Aug 15, 2023

In the changes for go mod download for Go 1.21, we chose not to support toolchain upgrades during go mod download, because it was going to be fairly complicated to get right, and it wouldn't affect CI systems or users who run a plain go mod download before running tests:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/modcmd/download.go;l=184-198;drc=8035de592fbc782d27eb78e914ca4e04ec991a3f

However, it turns out that it would be very useful for the Go module proxy itself — and probably other proxy implementations as well — to be able to go mod download specific module versions, branches, latest, and so on even if they require a newer toolchain than the one the proxy runs by default.

This is especially important for minor releases, since modules may declare (say) go 1.21.3 as soon as Go 1.21.3 is released, which (in order to produce checksums for such a module) would require the proxy maintainer to either immediately deploy the new release for all modules (which greatly complicates pre-deployment testing), or detect failures and explicitly retry (which is exactly what go mod download itself would do).

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go release-blocker modules labels Aug 15, 2023
@bcmills bcmills added this to the Go1.22 milestone Aug 15, 2023
@bcmills bcmills self-assigned this Aug 15, 2023
@bcmills
Copy link
Contributor Author

bcmills commented Aug 15, 2023

@gopherbot, please backport to Go 1.21. This is a blocker for the Go module proxy to be able to deploy Go 1.21 releases with adequate pre-release testing.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #62055 (for 1.21).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@dmitshur
Copy link
Contributor

CC @golang/tools-team (since this involves the Go module mirror). Also CC @golang/release as FYI.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/537480 mentions this issue: cmd/go: allow 'go mod download' to switch toolchains if called with explicit arguments

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/539697 mentions this issue: [release-branch.go1.21] cmd/go: allow 'go mod download' to switch toolchains if called with explicit arguments

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/540779 mentions this issue: cmd/go: allow toolchain upgrades in 'go mod download' when we would already allow go.mod updates

gopherbot pushed a commit that referenced this issue Nov 8, 2023
…lready allow go.mod updates

This fixes an inconsistency that was introduced in CL 537480 and noted
in the review on CL 539697.

In particular, 'go mod download' already updates the go.mod file when
other kinds of updates are needed. (#45551 suggested that it should
not do so, but that part of the change was not implemented yet;
finishing that change is proposed as #64008.)

Updates #62054.

Change-Id: Ic659eb8538f4afdec0454737e982d42ef8957e56
Reviewed-on: https://go-review.googlesource.com/c/go/+/540779
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopherbot pushed a commit that referenced this issue Nov 9, 2023
…lchains if called with explicit arguments

Fixes #62055.
Updates #62054.

Change-Id: I4ea24070f7d9aa4964c2f215836602068058f718
(cherry picked from CL 540779 and CL 537480)
Reviewed-on: https://go-review.googlesource.com/c/go/+/539697
Auto-Submit: Heschi Kreinick <heschi@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants
@dmitshur @bcmills @gopherbot and others