-
Notifications
You must be signed in to change notification settings - Fork 18k
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: reject to download toolchain when gotoolchain < go directive #72003
Comments
Change https://go.dev/cl/653237 mentions this issue: |
I'm not sure that this is necessarily incorrect behavior. The toolchain sets a minimum required version for the toolchain- it doesn't pin the toolchain at that version. |
HI @matloob , thanks for reply. I don't know whether it's wrong or not as well, but probably the error message 'toolchain not available' could be improved, as my CL does. The CL prints the error before it really starts to download(and fail). In cases I mentioned above, go complains to me ''toolchain not available', and as a user I don't know what happened and how to fix it until I try to revise the toolchain to make it higher than go line. It's quite confusing in case 2 as there is a go1.24 but why toolchain of go1.24 for darwin/amd64 is unavailable. |
For case 2, the problem is that go1.24 is a language version and not a toolchain version so when the Go Command would download go1.24 it wouldn't exist. We fixed this in go 1.23 (#62278) to download go1.X as 1.X.0. So hopefully that improves the confusion!
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Both case 1 and case 2 should be rejected, because
go.mod
reference said.Hence, before we actually downloading toolchain, we should check the version inside
go.mod
and report an error.For example,
go: suggested go toolchain go1.23.0 cannot be less than required go version 1.24
Besides, the case2 looks weird in real usage.
What did you see instead?
The text was updated successfully, but these errors were encountered: