-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: error out of 'go mod tidy' if the go.mod file specifies a newer-than-supported Go version #46142
Comments
@gopherbot, please backport to Go 1.15 and 1.16. We don't want users on older Go releases to accidentally break the invariants of the modules they're working in. |
Backport issue(s) opened: #46143 (for 1.15), #46144 (for 1.16). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/319669 mentions this issue: |
Change https://golang.org/cl/319671 mentions this issue: |
Change https://golang.org/cl/319670 mentions this issue: |
Change https://golang.org/cl/319709 mentions this issue: |
Change https://golang.org/cl/319710 mentions this issue: |
…iles in TestScript/mod_readonly For some reason, the go.mod file added to this test in CL 147281 lists 'go 1.20' instead of the version that was actually current when the go.mod file was added. That causes the test's behavior to change under lazy loading, because 1.20 is above the threshold to trigger lazy-loading invariants (1.17). This backports CL 314049 to Go 1.16 in order to fix a spurious test failure in a subsequent change. For #46144 Updates #46142 Updates #36460 Change-Id: I92400996cb051ab30e99bfffafd91ff32a1e7087 Reviewed-on: https://go-review.googlesource.com/c/go/+/314049 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/319670 Reviewed-by: Jay Conrod <jayconrod@google.com>
…version is newer than supported This backports the test from CL 319669, but — because of extensive changes to the module loader during the Go 1.17 cycle — the implementation is entirely different. (This implementation is based on the addGoStmt function present in init.go in the 1.16 branch.) Fixes #46144 Updates #46142 Change-Id: Ib7a0a159e53cbe476be6aa9a050add10cc750dec Reviewed-on: https://go-review.googlesource.com/c/go/+/319671 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
…iles in TestScript/mod_readonly For some reason, the go.mod file added to this test in CL 147281 lists 'go 1.20' instead of the version that was actually current when the go.mod file was added. That causes the test's behavior to change under lazy loading, because 1.20 is above the threshold to trigger lazy-loading invariants (1.17). This backports CL 314049 to Go 1.15 in order to fix a spurious test failure in a subsequent change. For #46143 Updates #46142 Updates #36460 Change-Id: I92400996cb051ab30e99bfffafd91ff32a1e7087 Reviewed-on: https://go-review.googlesource.com/c/go/+/314049 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/319709 Reviewed-by: Jay Conrod <jayconrod@google.com>
…version is newer than supported This backports the test from CL 319669, but — because of extensive changes to the module loader during the Go 1.16 and 1.17 cycles — the implementation is entirely different. (This implementation is based on the addGoStmt function already present in init.go.) Fixes #46143 Updates #46142 Change-Id: Ib7a0a159e53cbe476be6aa9a050add10cc750dec Reviewed-on: https://go-review.googlesource.com/c/go/+/319710 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org>
For #36460, Go 1.17 will add redundancy in
go.mod
files that would be removed bygo mod tidy
in earlier versions of the toolchain. We should makego mod tidy
fail if it doesn't definitively know what invariants a tidy module requires — that is, if thego.mod
file specifies a newer-than-supported version of the toolchain.(@jayconrod, @matloob: I thought we already had an issue filed for this but I can't find it now. Does it ring a bell?)
The text was updated successfully, but these errors were encountered: