osbuild / images

Image builder image definition library
Apache License 2.0
23 stars 52 forks source link

go.mod: use go 1.22.0 #955

Closed achilleas-k closed 1 month ago

achilleas-k commented 1 month ago

947 needed a go version update in the go.mod which dependabot didn't change.

After I added the change myself, I remembered it needs changes in more places.

Instead of polluting the dependabot PR with all this, let's do the change separately so it's more visible and I'll have dependabot rebase the PR after it's merged.

achilleas-k commented 1 month ago

Ok, updating golangci-lint worked. Now it's yelling at me because it found a bunch of things to complain about. Better get fixing.

achilleas-k commented 1 month ago

Hold off on merging, please. I'm discussing the rng seed with @mvo5.

lzap commented 1 month ago

This breaks image builder which uses downstream Go Toolbox from UBI which sitting at 1.21.13 at the moment. I do not think this hard dependency can be updated to 1.22 or even 1.23 for tools yet:

https://github.com/osbuild/image-builder/pull/1363

achilleas-k commented 1 month ago

Do you know if the next release of the UBI Go Toolbox will be 1.22? Afaik, 9.5 will ship with Go 1.22. And osbuild-composer in 9.5 will still be using 1.21 anyway, since the version for that is already frozen.

lzap commented 1 month ago

I do not know. But we are unable to upgrade images in image builder until it happens. From prior history, 1.21.13 was released 2024-08-06 but updated in UBI 2024-10-03. That is 2 months lag, I suggest to hold on these upgrades in the library by pinning those dependencies which require new version of Go. Unfortunately, Go tools themselves does not have any features for that, what we did in the past was simply reinstalling particular versions after full update:

# update to latest and greatest
go get -u ./...

# pin specific libs
go get -u library/requiring/new/go@v1.2.3

# and modify the go.mod back to a reasonable version
go mod tidy

Something like that.