Skip to content

build: Bump go version to 1.22 #1085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

anoopcs9
Copy link
Collaborator

@anoopcs9 anoopcs9 commented Mar 6, 2025

At least one of the requires, github.com/aws/smithy-go, bumped its minimum go version requirement to 1.22.

Module Highlights

  • github.com/aws/smithy-go: v1.22.3
  • Dependency Update: Bump minimum Go version to 1.22 per our language support policy.

At least one of the requires, github.com/aws/smithy-go, bumped its
minimum go version requirement to 1.22.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
@anoopcs9 anoopcs9 added the no-API This PR does not include any changes to the public API of a go-ceph package label Mar 6, 2025
Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we include the new toolchain line as part of this too?

@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Mar 6, 2025

Shouldn't we include the new toolchain line as part of this too?

toolchain go1.22 will be simply ignored(and removed) because of the go 1.22 line above and as you mentioned 'z' release is probably not required. Let me know if you think otherwise.

@phlogistonjohn
Copy link
Collaborator

OK.... so it got added in the other PR only because the Go line is less than 1.22? If so OK. But I didn't get that impression when I read the docs yesterday.

@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Mar 6, 2025

OK.... so it got added in the other PR only because the Go line is less than 1.22? If so OK. But I didn't get that impression when I read the docs yesterday.

Yes, I verified this by removing the toolchain line from go.mod after applying the other patch and updated go line to 1.22 and a subsequent go mod tidy was silent about toolchain. Whereas with go 1.21 it wanted toolchain line pointing at local go version.

@phlogistonjohn
Copy link
Collaborator

OK, thanks for clarifying.

@mergify mergify bot merged commit 5b669ff into ceph:master Mar 6, 2025
15 checks passed
@ansiwen
Copy link
Collaborator

ansiwen commented Mar 6, 2025

I also wanted to understand (again) the difference between go and toolchain lines, and my fresh insight from a minute ago is the following:

  • "The go line for each module sets the language version the compiler enforces when compiling packages in that module."
  • "The toolchain line declares a suggested toolchain to use with the module or workspace."
  • toolchain defaults to the go version, if not specified.
  • "A module’s go line must declare a version greater than or equal to the go version declared by each of the modules listed in require statements."

In short: the go line is "infectious" to modules that import go-ceph, and should be kept as low as possible, where toolchain has no effect on importing modules, but only what we are using when we work on go-ceph. So what dependabot suggested is indeed less invasive, and doesn't bother other users of go-ceph.

@phlogistonjohn
Copy link
Collaborator

Thanks, I think 1.22 is current version + 2 so I think we're OK, but the next time the topic comes up we should certainly consider leaving it to a version that's as old as reasonable possible.

@anoopcs9 anoopcs9 deleted the bump-go-vers-1.22 branch March 7, 2025 02:31
@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Mar 7, 2025

* "A module’s go line must declare a version greater than or equal to the go version declared by each of the modules listed in require statements."

Going by the above statement I think we did the right thing to bump up the go line to 1.22 because the go version declared by https://github.com/aws/smithy-go has been updated to 1.22. I reconfirmed that go mod tidy replaces the version from go line anything lesser to 1.22 because it is the minimum from the list of required modules(including github.com/aws/smithy-go) for go-ceph.

In short: the go line is "infectious" to modules that import go-ceph, and should be kept as low as possible, where toolchain has no effect on importing modules, but only what we are using when we work on go-ceph. So what dependabot suggested is indeed less invasive, and doesn't bother other users of go-ceph.

Thanks, I understand it better now but we couldn't have avoided bumping the go version from our go.mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-API This PR does not include any changes to the public API of a go-ceph package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants