-
Notifications
You must be signed in to change notification settings - Fork 46
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
Preliminary support for Go 1.22 #1004
Conversation
Commit c7fbbb1 framed this as an InvalidRepoStructure, but using Go workspaces is still a perfectly valid repo structure, it's just that we haven't added support for that feature of Go yet. Signed-off-by: Erik Skultety <[email protected]>
Not specifically related to this PR, but what do you think about having a log message with the version of the toolchain being executed? As I was testing these changes with a project that was using 1.22.0, I didn't see that toolchain version anywhere in the cachito request logs (just athens). It might be helpful for some future debugging to have that information available |
That version isn't explicitly reported by Go anywhere though. The only information on the target toolchain we have is |
When commit d9d1620 enabled full Go 1.21 support the semantics it used for the Go toolchain selection conditions was very unfortunate as it revolved too much around the 'go_max_version' variable which at the time was set to be 1.21. The problem there is that once we try bumping the max version to say 1.22 the conditions stop making sense and as a bonus the existing tests start failing. The reasons for that are the following: - we're not actually planning on updating the container image with each Go version we're going to support unless absolutely necessary; that is thanks to the GOTOOLCHAIN=auto mechanism introduced by 1.21 that will download any new toolchain as needed automatically - without changing unit tests we suddenly can't pass the trivial condition on selecting the old fallback 1.20 if the existing unit test's base Go release is 1.21.X and the new max supported version is 1.22 Tweak the selection conditions so that they finally make sense semantically: - use go_max_version only to check incoming requests for incompatible new releases - otherwise always explicitly compare against 1.21 and only fall back to 1.20 if the base release is above 1.21 which would lead to dirtying the source repo due to compatibility issues on Golang's side Fixes: d9d1620 Signed-off-by: Erik Skultety <[email protected]>
@taylormadore Here's my take on the log message - I added an extra commit which tweaks the |
My initial thought was to report the output of the |
Oh, right. That means we have to stuff another go call in there somewhere before we commence with the module download.Okay, but that might require some bigger changes and actually not be that transparent from code perspective - because on one hand we're instantiating a specific toolchain as |
@brunoapimentel @taylormadore FYI several openshift teams are waiting on 1.22 support in cachito for the 4.16 OCP release :) Please review :) |
This won't likely help any of them since kubernetes uses vendored workspaces which this doesn't add support for. |
Unless we run |
I'd be ok with that approach and it's definitely not a blocker for this PR and we can resolve it in a follow-up issue. |
|
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.
LGTM
This commit introduces just preliminary support of 1.22. More specifically, we still reject any project relying on workspaces, be it original workspaces, or vendored workspaces as the feature introduced by 1.22. Signed-off-by: Erik Skultety <[email protected]>
fe18efa
This PR basically just bumps the maximum supported version to 1.22 from 1.21. The changes don't include everything that 1.22 brings, most notably vendored workspaces (we don't even support base workspaces).
Maintainers will complete the following section