-
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/go: GOTOOLCHAIN=<name>+[auto|path] is incorrectly rejected as "invalid minimum toolchain" #61068
Comments
Change https://go.dev/cl/507595 mentions this issue: |
The reported behavior is explicitly described in the code documentation. With something like "go1.21rc2", go/src/cmd/go/internal/gover/gover.go Lines 168 to 175 in 03cd8a7
Good to know, as go1.21 is not released, a dev version is returned.
|
@iwdgo That snippet talks about "prereleases (alpha, beta, rc) for patch releases", which isn't relevant here. It's true that # Works as expected without +auto suffix.
$ GOTOOLCHAIN=go1.20.5 go version
go version go1.20.5 darwin/arm64
$ GOTOOLCHAIN=go1.20rc3 go version
go version go1.20rc3 darwin/arm64
# Fails to work with +auto suffix.
$ GOTOOLCHAIN=go1.20.5+auto go version
go: invalid GOTOOLCHAIN "go1.20.5+auto": invalid minimum toolchain "go1.20.5"
$ GOTOOLCHAIN=go1.20rc3+auto go version
go: invalid GOTOOLCHAIN "go1.20rc3+auto": invalid minimum toolchain "go1.20rc3" |
Change https://go.dev/cl/508820 mentions this issue: |
The call from toolchain.Select to gover.FromToolchain was passing the wrong argument but this was masked by gover.IsValid being a little bit too lax. Fix and test IsValid, which then breaks the existing gotoolchain_local test, and then fix toolchain.Select to fix the test. Fixes golang#61068. Change-Id: I505ceb227457d6a51bd5e47f009b2fb1010c0d1f Reviewed-on: https://go-review.googlesource.com/c/go/+/508820 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
The Go toolchain selection section in https://go.dev/doc/toolchain documents that GOTOOLCHAIN may have "<name>+auto" or "<name>+path" form. These are currently rejected in go1.21rc2 and at tip:
A quick look at the code suggests at least part of the problem is that
gover.FromToolchain
is being called with the wrong argument:go/src/cmd/go/internal/toolchain/select.go
Lines 132 to 134 in 03cd8a7
Instead of the intended
gover.FromToolchain(min)
. I haven't looked if there's more to it or not.CC @rsc, @bcmills, @matloob.
The text was updated successfully, but these errors were encountered: