-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/compile: Go 1.22 changes support for modules that declare go 1.0
#65528
Comments
go 1.0
Both
On the other hand, So I think two things need to happen here:
|
go 1.0
go 1.0
Lang("go1.0") = "go1" is correct; the compiler should accept "go1" in addition what it currently accepts namely "go1.0". |
Change https://go.dev/cl/562322 mentions this issue: |
@gopherbot, please backport to Go 1.22. This was a regression in 1.22.0 and the fix is trivial. |
Backport issue(s) opened: #65619 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
On go.dev/cl/562322, I pointed out that cmd/go does not support "go 1" in go.mod files. @bcmills says this is expected because "go 1.0 is not the canonical name for that version." I'll also point out that If cmd/go won't let its users spell Go language version "1.0" as "1", why did it start spelling "-lang=go1.0" as "-lang=go1"? Why is it cmd/compile's responsibility to now accept either spelling? Can cmd/go instead revert to the original spelling that it still requires from users? Thanks. |
Go 1.22 breaks modules that declare go 1.0: golang/go#65528 This PR modifies the Go version in go.mod to 1.14 because module must run on Go version 1.14 or later, as documented in https://go.dev/doc/modules/gomod-ref
Fixes golang#65528. Change-Id: I55fef8cf7be4654c7242462d45f12999e0c91c02 Reviewed-on: https://go-review.googlesource.com/c/go/+/562322 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
* Make it possible for test .go files to import packages. * Fix import parsing and rendering. * Some more test coverage. * Refactor to remove a lot of p.isMax calls. * Add -strict and more test coverage. * Some refactoring and removing unnecessary lines of code. * Oops, finish adding -strict. Add test coverage. * Remove workaround now that a fix for golang/go#65528 is backported to Go 1.22. * Fix merge.
Go version
go version go1.22rc2 darwin/arm64
Output of
go env
in your module/workspace:(Shouldn't be relevant; happy to provide otherwise.)
What did you do?
I used a Go 1.22-ish toolchain, instead of a 1.21-ish one, to install the command
go.chromium.org/luci/cipd/client/cmd/cipd@latest
. It failed because one of its dependencies has a go module directive with an unusually-low value of "1.0" here, reporting a build error as:Here's a smaller reproducer:
What did you see happen?
What did you expect to see?
I'm not sure if this edge-case should work or not.
I read over https://go.dev/doc/toolchain#version, which includes:
But doesn't seem to specify what the minimum value of N is.
The new
go/version
package hasIsValid
, which reports true for "go1.0" and "go1". (https://go.dev/play/p/82xhtZbE9N9?v=gotip)The text was updated successfully, but these errors were encountered: