You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we report the toolchain we selected to process a project, e.g. 1.21.0 (pre-installed) but that toolchain might not end being the one to be used for the given project as the project may specify any micro release for the toolchain it desires (e.g. 1.21.8) which we're currently handling by passing GOTOOLCHAIN=auto to the underlying Go process which will first download the desired toolchain and then process the requested command (and project) with it.
We should ideally report the target toolchain that we're invoking instead of the intermediary toolchain that will just download the target one.
The text was updated successfully, but these errors were encountered:
I worried for a moment that we'd fall into the trap of reporting the wrong toolchain due to automatic toolchain switching Go's capable of (e.g. [email protected] requires go >= 1.21.7; switching to go1.21.10), but that only happens during go build and only after go mod tidy (e.g. without running tidy: [email protected] requires go >= 1.21.7 (running go 1.21.4)). In either case, for a project dependency prefetch, all of the mentioned above is irrelevant as the toolchain declared by the main project has always has to be >= to the highest toolchain version of all of its dependencies, IOW the toolchain keyword specified by a dependency only gains meaning when building the dependency itself as the main module, but not when building it indirectly; as confirmed by docs:
Modules that are dependencies of other modules may need to set a minimum Go version requirement lower than the preferred toolchain to use when working in that module directly. In this case, the toolchain line in go.mod or go.work sets a preferred toolchain that takes precedence over the go line when the go command is deciding which toolchain to use.
Currently, we report the toolchain we selected to process a project, e.g. 1.21.0 (pre-installed) but that toolchain might not end being the one to be used for the given project as the project may specify any micro release for the toolchain it desires (e.g. 1.21.8) which we're currently handling by passing GOTOOLCHAIN=auto to the underlying Go process which will first download the desired toolchain and then process the requested command (and project) with it.
We should ideally report the target toolchain that we're invoking instead of the intermediary toolchain that will just download the target one.
The text was updated successfully, but these errors were encountered: