-
Notifications
You must be signed in to change notification settings - Fork 288
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
Bump go mod version from 1.22 to 1.22.0 to fix toolchain download issue #2267
Comments
@cmoulliard I have a question about this. If we bump the go mod version to For example, on my machine, I can see the latest pack version was compiled using go >$ which pack
/home/linuxbrew/.linuxbrew/bin/pack
>$ go version /home/linuxbrew/.linuxbrew/bin/pack
/home/linuxbrew/.linuxbrew/bin/pack: go1.22.5
>$ pack version
0.35.1+git-3a22a7f.build-6099 If we set the go.mod to |
I'm not a go expert but I don't think so as according to the documentation of the toolchain - https://go.dev/doc/toolchain "In the standard configuration, the go command uses its own bundled toolchain when that toolchain is at least as new as the go or toolchain lines in the main module or workspace. For example, when using the go command bundled with Go 1.21.3 in a main module that says go 1.21.0, the go command uses Go 1.21.3. When the go or toolchain line is newer than the bundled toolchain, the go command runs the newer toolchain instead. For example, when using the go command bundled with Go 1.21.3 in a main module that says go 1.21.9, the go command finds and runs Go 1.21.9 instead. It first looks in the PATH for a program named go1.21.9 and otherwise downloads and caches a copy of the Go 1.21.9 toolchain. This automatic toolchain switching can be disabled, but in that case, for more precise forwards compatibility, the go command will refuse to run in a main module or workspace in which the go line requires a newer version of Go. That is, the go line sets the minimum required Go version necessary to use a module or workspace." |
I will try to test the github action to double check how it behaves |
Have you been able to test ? |
@cmoulliard oh man, no! sorry |
Description
TL&DR
Pack cannot be build in an hermetic and containerized environment as the version of go
1.22
declared within the go.mod file do not correspond to a toolchain version1.22.0
- see: https://go.dev/blog/toolchainSuch a limitation comes from Golang itself how it processes go.mod files. When Go sees the language version, but not a toolchain version, i.e.
1.22
vs1.22.0
it's not going to be able to download a correct toolchain for the given language version. Go community is aware of that problem and they fixed it in1.23
so that the inference of the.0
th toolchain from a particular language version works.Proposed solution
Bump the go version defined within the go.mod file
Additional context
See error reported when building pack in an hermetic and containerized environment
The text was updated successfully, but these errors were encountered: