Skip to content

chore: update Go to 1.23 - #1433

Closed
lzap wants to merge 1 commit into
osbuild:mainfrom
lzap:bump123
Closed

lzap wants to merge 1 commit into
osbuild:mainfrom
lzap:bump123

Conversation

@lzap

@lzap lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

@lzap
lzap requested a review from a team as a code owner April 15, 2025 08:56
@achilleas-k

Copy link
Copy Markdown
Member

Thanks!!

There's some Go version pinning in the test workflow too: https://github.com/osbuild/images/blob/a33dc725f80ea75d08f86f52abcbd53f2186b0ce/.github/workflows/tests.yml

Annoying, I know. Having a single place where it's defined where all sources could read it would be nice, but I don't know if parsing the go.mod or something similar is the nicest way to do it.
For now let's just bump the version there as well and think about a better solution another time.

@thozza

thozza commented Apr 15, 2025

Copy link
Copy Markdown
Member

Annoying, I know. Having a single place where it's defined where all sources could read it would be nice, but I don't know if parsing the go.mod or something similar is the nicest way to do it. For now let's just bump the version there as well and think about a better solution another time.

I thought about this in the past and I have two ideas:

  • Define a variable with the Go version at the top of the workflow file and use it everywhere. Bumping it then means changing it only in a single place.
  • Actually extract the version from go.mod in a job and set a variable with the value. All other jobs should then use that to setup Go. I tried this in the past elsewhere and it is possible. The best part is that this means updating Go version only in go.mod...

@achilleas-k

Copy link
Copy Markdown
Member

Annoying, I know. Having a single place where it's defined where all sources could read it would be nice, but I don't know if parsing the go.mod or something similar is the nicest way to do it. For now let's just bump the version there as well and think about a better solution another time.

I thought about this in the past and I have two ideas:

  • Define a variable with the Go version at the top of the workflow file and use it everywhere. Bumping it then means changing it only in a single place.
  • Actually extract the version from go.mod in a job and set a variable with the value. All other jobs should then use that to setup Go. I tried this in the past elsewhere and it is possible. The best part is that this means updating Go version only in go.mod...

I suppose reading from the go.mod is best since that's the one authoritative source of truth.

@lzap
lzap force-pushed the bump123 branch 2 times, most recently from fe41e96 to 694589f Compare April 15, 2025 12:03
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

@achilleas-k

Copy link
Copy Markdown
Member

@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

Had to put setup-go after checkout, obviously it needs go.mod to be present.

@lzap
lzap force-pushed the bump123 branch 2 times, most recently from ffe2656 to 8d53214 Compare April 15, 2025 13:39
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

So "Unit tests" actions were completely missing setup-go so I guess it was running with a "random" Go version that gets installed into Ubuntu image. Added at both places to workaround:

Run go test -race  ./...
go: go.mod requires go >= 1.23.6 (running go 1.23.4; GOTOOLCHAIN=local)

@lzap
lzap force-pushed the bump123 branch 2 times, most recently from 9eda644 to b0c58fb Compare April 15, 2025 13:57
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

Just realized we need to keep the Go version as low as the oldest supported OS, Go was only updated to 1.23 in UBI9 but not in RHEL9 so I guess this is a dead end for me for now.

@lzap lzap closed this Apr 15, 2025
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

Wait COS9 has Go 1.23 is it is just Fedora I assume.

@lzap lzap reopened this Apr 15, 2025
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

I will rebase this once we remove F40.

Does anyone know what this error message is:

Run go test -race ./... -test.skip 'TestBlockingResolverLocalManifest|TestResolverLocalManifest'
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown

@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

So to sum it up:

  • Fedora 40: Go 1.22 (we are dropping it soon)
  • Fedora 41: Go 1.23.4
  • CentOS 9: Go 1.23.7
  • CentOS 10: Go 1.23.1

So the final Go version will be: Go 1.23.1 🎉

@achilleas-k

Copy link
Copy Markdown
Member

So we keep this open until we're ready to drop F40?

@lzap
lzap marked this pull request as draft April 15, 2025 15:52
@lzap

lzap commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

So we keep this open until we're ready to drop F40?

Looks like a plan, converted to draft for the time being.

@mvo5
mvo5 requested a review from croissanne April 23, 2025 10:26
@github-actions

Copy link
Copy Markdown

This PR is stale because it had no activity for the past 30 days. Remove the "Stale" label or add a comment, otherwise this PR will be closed in 7 days.

@github-actions github-actions Bot added the Stale label May 24, 2025
@lzap

lzap commented May 26, 2025

Copy link
Copy Markdown
Contributor Author

Closing for now until we get rid of F40.

@lzap lzap closed this May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants