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.
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
chore: relax go directive to permit 1.22.x #2323
chore: relax go directive to permit 1.22.x #2323
Changes from all commits
67ba70c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make/force to download Go1.23.4 and then you will not build with go1.22 anymore
so i think here we need to be in go1.23.4 and the toolchain request that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're possibly misunderstanding here? The
go
directive specifies the api compatibility of the module and thetoolchain
directive specifies a suggested/recommended toolchain to use when building. Only the former has an effect on Go code that imports rekor as a module. The latter only applies as a hint to the rekor build itself and even then it is advisory and can be superseded in various ways.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnwe thanks for the clarification but my understanding was that it will require updating go when building, and if any downstream projects import rekor they will be required to use the go 1.23 as well and not 1.22
But I think I did not understand that. I think I am totally wrong. This isn't very clear to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah for anything importing rekor toolchain is completely ignored, that’s only used if people go install rekor standalone or clone and build the repo (and even then only if their GOTOOLCHAIN contains auto)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've learned, the motivation to set
toolchain
is so that local development matches what we build the release binaries with, given we're keeping the Dockerfile Go container up to date (to pull in the latest security patches), and we'll keeptoolchain
in sync.We should set the go.mod version to be as low as possible, based on if we need features from a newer version of Go. This is for libraries that depend on Rekor, which they themselves can choose to build with either the newest Go binary or one that matches the go.mod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 toolchain does not cascade to imports, go directive can stay 1.22 alongside using a newer toolchain to build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we are downgrading and not keep in go1.23?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not downgrading, we are permissively declaring "this go.mod file and the module source code is API compatible with the Go standard library and toolchain from go version 1.22.0 onwards"