Repository navigation
fix(all): lower the minimum Go version to 1.26.9 - #261
Merged
Merged
Conversation
Match Incus' minimum so distro packagers don't need the newest Go. Releases and CI still build with the latest 1.27.x; a new job checks the minimum. Closes lxc#258 Signed-off-by: Michał Lipski <michal@tallica.pl>
Member
|
Thank you! |
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.
Closes #258
As requested in #258, this splits the Go version we build with from the minimum we support:
go.modnow declaresgo 1.26.9, the same minimum as Incus. It is also the highest version any of our dependencies require (lxc/incus/v7,pires/go-proxyproto).1.27.x. The workflows now usego-version: "1.27.x"withcheck-latest: trueinstead ofgo-version-file: go.mod.What had to change
types.ServiceConfig{Image: ...}. Thegoline ingo.modsets the language version, so withgo 1.26.9those literals stop compiling on any Go version, 1.27.x included. The affected tests now name the embedded struct explicitly (ContainerSpec: types.ContainerSpec{...},WorkloadSpec, and Incus'InstancePut). This only touches test files; the non-test code already built at 1.26.GOTOOLCHAIN: the workflows setGOTOOLCHAIN: go1.27.0+auto. With the lowergo.mod, that would make every build switch to Go 1.27.0 and ignore the 1.27.x installed bysetup-go. It is nowGOTOOLCHAIN: local, so builds use exactly the Go thatsetup-goinstalled.Minimum version build
A new workflow,
test-min-go.yml, installs the version fromgo.mod(1.26.9) withGOTOOLCHAIN: localand runs:go build ./...go vet ./...with and without thee2etag; this catches standard-library APIs newer than the minimumgo test -run '^$', with and without thee2etag, since most tests need a live Incus serverI ran the same steps locally with Go 1.26.9 and they pass.