Set GOTOOLCHAIN=local when building Go projects
In https://gitlab.com/gitlab-com/gl-infra/capacity-planning-trackers/gitlab-com/-/issues/1796#note_1956622443, we found that Workhorse quietly updated go.mod
to use toolchain go1.22.3
, which caused a quiet upgrade from Go 1.21.9 to 1.22.3. This exposed a Goroutine leak in Workhorse.
https://go.dev/doc/toolchain basically says that if go.mod
specifies a toolchain version higher than the current Go compiler installed, the toolchain version will be fetched and used.
I presume we still want to centralize Go upgrades within Omnibus and Cloud Native GitLab, so we might want to set GOTOOLCHAIN=local
in the build environment to disable this tooling auto-update.