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: mod tidy reports toolchain not available with 'go 1.21' #62278
Comments
how did you end up with |
I can't remember exactly, but I think it was rather manual like: |
I am seeing this problem on linux/ppc64le.
|
@matthewhughes-uw, this is as expected: In general if you want to specify a development version in the go 1.21.0 or go 1.21
toolchain go1.21.0 |
@laboger, the problem you are seeing is similar. In particular, if you are working within |
As far as I can tell this is all working as designed. @matthewhughes-uw, are there specific documentation changes that would have helped you solve or avoid this problem? |
👍
I think the main issue was my assumption that, previously I could just specify a language version (per https://go.dev/doc/toolchain#version) i.e.
and within the linked page
so I guess it wasn't clear to me that a "language version" != a "Go release version" (though it was true for every language version before Go 1.21)
🤔 Maybe it's worth documenting something like "If you want to specify a 'language version' in |
To add to this: what really happened here that causes a bit of confusion is that the value of Before 1.21 release With 1.21 release you most likely want to put So the way I see it we went from Having now also |
According to [1] as of Go 1.21 we either need to specify the full toolchain version in the `go` directive or add a `toolchain` directive with the concrete toolchain version. Opt for the former and make sure it's kept up to date by renovate bot. [1] golang/go#62278 (comment) Signed-off-by: Tobias Klauser <tobias@cilium.io>
According to [1] as of Go 1.21 we either need to specify the full toolchain version in the `go` directive or add a `toolchain` directive with the concrete toolchain version. Opt for the former and make sure it's kept up to date by renovate bot. [1] golang/go#62278 (comment) Signed-off-by: Tobias Klauser <tobias@cilium.io>
…cussions/65431 Signed-off-by: David J. M. Karlsen <david.johan.macdonald.karlsen@dnb.no>
see golang/go#62278 and dependabot/dependabot-core#7895 for details
see golang/go#62278 and dependabot/dependabot-core#7895 for details
see golang/go#62278 and dependabot/dependabot-core#7895 for details
see golang/go#62278 and dependabot/dependabot-core#7895 for details
see golang/go#62278 and dependabot/dependabot-core#7895 for details
see golang/go#62278 and dependabot/dependabot-core#7895 for details
Ref: - golang/go#62278 (comment) may require re-installing go language server after upgrading to 1.21 ```sh go install golang.org/x/tools/gopls@latest ``` or: 1. Press Ctrl Shift P 1. Select Go: Install/Update tools
since go 1.21 we need to specify also the minor go version: golang/go#62278 without it dependabot is failing with: ``` Dependabot encountered the following error: go: downloading go1.21 (linux/amd64) go: download go1.21 for linux/amd64: toolchain not available ```
since go 1.21 we need to specify also the minor go version: golang/go#62278 without it dependabot is failing with: ``` Dependabot encountered the following error: go: downloading go1.21 (linux/amd64) go: download go1.21 for linux/amd64: toolchain not available ``` docker build image for the builder has also been upgraded to 1.21.
since go 1.21 we need to specify also the minor go version: golang/go#62278 without it dependabot is failing with: ``` Dependabot encountered the following error: go: downloading go1.21 (linux/amd64) go: download go1.21 for linux/amd64: toolchain not available ``` docker build image for the builder has also been upgraded to 1.21.
* fix: go mod changed format Ref: - golang/go#62278 (comment) may require re-installing go language server after upgrading to 1.21 ```sh go install golang.org/x/tools/gopls@latest ``` or: 1. Press Ctrl Shift P 1. Select Go: Install/Update tools * chore: bump gh action versions | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `2.4.0` | `4.0.0` | | [actions/cache](https://github.com/actions/cache) | `2` | `3` | | [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `1.6.1` | `4.0.0` | | [actions/setup-python](https://github.com/actions/setup-python) | `3` | `4` | | [mfinelli/setup-shfmt](https://github.com/mfinelli/setup-shfmt) | `1` | `2` | | [dorny/paths-filter](https://github.com/dorny/paths-filter) | `2.10.2` | `2.11.1` | | [terraform-linters/setup-tflint](https://github.com/terraform-linters/setup-tflint) | `2` | `3` | * chore: run make update-golden-files * chore: Add PR conventional commit title check
PR #1536 broke "renovate update Go toolchain in a single PR" from #1259. From cilium/cilium@2f7e2f3: According to [1] as of Go 1.21 we either need to specify the full toolchain version in the `go` directive or add a `toolchain` directive with the concrete toolchain version. Opt for the former and make sure it's kept up to date by renovate bot. [1] golang/go#62278 (comment) Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
PR #1536 broke "renovate update Go toolchain in a single PR" from #1259 because in the actual state it could only bump the go directive from minor versions, not bumping the patch needed by the workflows github actions reading that version. From cilium/cilium@2f7e2f3: According to [1] as of Go 1.21 we either need to specify the full toolchain version in the `go` directive or add a `toolchain` directive with the concrete toolchain version. Opt for the former and make sure it's kept up to date by renovate bot. [1] golang/go#62278 (comment) Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
PR #1536 broke "renovate update Go toolchain in a single PR" from #1259 because in the actual state it could only bump the go directive from minor versions, not bumping the patch needed by the workflows github actions reading that version. From cilium/cilium@2f7e2f3: According to [1] as of Go 1.21 we either need to specify the full toolchain version in the `go` directive or add a `toolchain` directive with the concrete toolchain version. Opt for the former and make sure it's kept up to date by renovate bot. [1] golang/go#62278 (comment) Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
Addresses this issue with Dependabot and the Go toolchain: golang/go#62278
The version provided in the go directive must be a valid Go version. go1.21 refers to a development version of Go, not a released version. Prior to 1.21, 1.X was actually the first released version for Go language version 1.X. Starting with 1.21, the first released version is 1.X.0, and the go directive in go.mod should correspond to a valid toolchain version (unless a toolchain directive is also present). One way to reproduce the issue is to run: `GOTOOLCHAIN="go1.20+auto" go version` When using the `go 1.21` directive, the above command will fail as go will try to download toolchain 1.21, which does not exist. See golang/go#62278 for a detailed discussion. Signed-off-by: Antonin Bas <abas@vmware.com>
The version provided in the go directive must be a valid Go version. go1.21 refers to a development version of Go, not a released version. Prior to 1.21, 1.X was actually the first released version for Go language version 1.X. Starting with 1.21, the first released version is 1.X.0, and the go directive in go.mod should correspond to a valid toolchain version (unless a toolchain directive is also present). One way to reproduce the issue is to run: `GOTOOLCHAIN="go1.20+auto" go version` When using the `go 1.21` directive, the above command will fail as go will try to download toolchain 1.21, which does not exist. See golang/go#62278 for a detailed discussion. Signed-off-by: Antonin Bas <abas@vmware.com>
Note: I think this is a question of: is "
go 1.21
" a valid go directive? since there was no1.21
release, only1.21.0
, perhaps notWhat version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, reproduced on Go 1.21.0
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Given a basic
go.mod
Then run:
What did you expect to see?
go mod tidy
runs successfully. I guess I expect it would pickgo1.21.0
as the toolchain if no toolchain is available as1.21
What did you see instead?
The error output above with a non-zero exit code
More details
The issue was seen when running
dependabot
on a repo with ago 1.21
directive ingo.mod
, theGOTOOLCHAIN
above was taken from their usage https://github.com/dependabot/dependabot-core/blob/08ac25ebd773cede0c00be9a98e5bb03b680870b/go_modules/Dockerfile#L34Running the above command with
GODEBUG=http2debug=1
I see it:go.dev/dl/mod/golang.org/toolchain/@v/v0.0.1-go1.21.linux-amd64.zip
which returnsLocation: https://go.dev/dl/mod/golang.org/toolchain/@v/v0.0.1-go1.21.linux-amd64.zip
location: https://dl.google.com/go/v0.0.1-go1.21.linux-amd64.zip
Updating the directive to:
go 1.21.0
will permit things to run fine.The text was updated successfully, but these errors were encountered: