build(collector): pin build toolchain to go1.26.7 - #2545
Open
arein wants to merge 1 commit into
Open
Conversation
`collector/go.mod` is the toolchain pin for released collector layers: `.github/actions/build-collector-layer/action.yml` runs `actions/setup-go` with `go-version-file: collector/go.mod`, and that action builds the published artifact. The `go` directive has been 1.26.1 across releases 0.22.0 and 0.23.0, so `go version -m` on the released 0.23.0 amd64 collector reports go1.26.1. go1.26.1 is affected by GO-2026-5026 / CVE-2026-39821 (Punycode handling in x/net/idna, vendored into the standard library and reachable through net/http), fixed in go1.26.6. The module's own golang.org/x/net is already v0.57.0, so only the stdlib copy is outstanding. Adds a `toolchain` directive rather than bumping `go`, so the minimum Go version required of importers of this module is unchanged. setup-go is pinned at v7.0.0 everywhere in this repo, and at that revision parseGoVersionFile prefers the `toolchain` directive over `go`. Signed-off-by: Derek Rein <alexanderderekrein@gmail.com>
|
Contributor
|
@arein I might be missing something but i am not following.
When would someone be importing the collector as a module? I can understand the other go-mod being imported when someone is building their own collector/layer. The bigger question for me is renovate is detecting the go version in the go mod, what has stoped it from being auto updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
toolchain go1.26.7directive tocollector/go.mod. Thegodirective stays at1.26.1, so the minimum Go version required of anyone importing this module does not change.Why
collector/go.modis the toolchain pin for released collector layers..github/actions/build-collector-layer/action.ymlrunsactions/setup-gowithgo-version-file: collector/go.mod, andrelease-layer-collector.ymlbuilds the published artifact through that action. That directive has been1.26.1across 0.22.0 and 0.23.0, so releases are built with go1.26.1.Confirmed against the published
layer-collector/0.23.0amd64 asset (zip sha25616d07443dd1b0059a16a3e62b1779d428a006e5f8de9232b37aebcee8935c838):go1.26.1 is affected by GO-2026-5026 / CVE-2026-39821 (Punycode handling in
x/net/idna, vendored into the standard library and reachable throughnet/http), which is fixed in go1.26.6. As the build info above shows, the module's owngolang.org/x/netis already v0.57.0, so the direct dependency is clear and only the stdlib copy is outstanding. Consumers scanning the layer see it as ago/stdlibfinding.To be clear, nothing here was overdue: 0.23.0 was built on 2026-08-01 and go1.26.6 was not tagged until 2026-08-13. There simply has not been a release since a patched toolchain existed. This is a nudge so the next one picks one up.
Independently reported in #2323.
Why a
toolchaindirective instead of bumpinggoBumping the
godirective would also raise the minimum Go version required of importers of this module, which seemed like the wrong side effect for a build-time concern. Atoolchaindirective pins the build without touching that.actions/setup-gois pinned at v7.0.0 (b7ad1dad31e06c5925ef5d2fc7ad053ef454303e) in all six places it appears in this repo, and at that exact revisionparseGoVersionFilepreferstoolchainovergo:The backwards-compatibility branch only applies when
GOTOOLCHAINis explicitly set tolocalin the environment, and there is noGOTOOLCHAINsetting anywhere in this repo. Note this is a v6+ behaviour, so it would not have worked while the repo was on setup-go v5.Sibling modules
collector/go.modis the onlygo.modanygo-version-filein this repo points at, so it is the only toolchain pin that reaches a published artifact. The other seven are deliberately left alone:lambdacomponents,lambdalifecycle,processor/coldstartprocessor,processor/decoupleprocessorandreceiver/telemetryapireceiverarereplaced into the collector module and compiled into the same binary by the singlego buildincollector/Makefile, so the toolchain selected above already builds them. Their owngodirectives never reachsetup-go.collector/internal/tools/go.modis tooling and is not part of the shipped layer.go/sample-apps/function/go.modis a sample app that no release workflow builds or publishes.setup-goat all, so they are not exposed to this.Happy to add the directive to the others for consistency if you would prefer it uniform.
Testing
Being straightforward about what I did and did not run. I could not compile the collector locally:
collector/go.modalready requires go >= 1.26.1, which is newer than the Go on my machine, and that was equally true before this change. What I did verify:go mod edit -jsonparses the patched file, reportingGo: 1.26.1andToolchain: go1.26.7.1.26.7rather than1.26.1.ci-collector.ymlbuilds and tests the collector on every PR using the samego-version-file: collector/go.mod, so this PR's own checks should exercise the new toolchain end to end. Worth a look at the build log to confirm it reports go1.26.7.