Skip to content
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(all): restore go 1.22 in go.mod #3011

Closed
wants to merge 3 commits into from

Conversation

quartzmo
Copy link
Member

@quartzmo quartzmo commented Feb 11, 2025

fixes: #3009

@quartzmo quartzmo requested a review from a team as a code owner February 11, 2025 20:56
@codyoss
Copy link
Member

codyoss commented Feb 11, 2025

I don't think we can make this change because of our dependencies have a patch level specified in thier go.mod.

@quartzmo
Copy link
Member Author

In Kokoro, it fails the go.mod diff check in latest-version (below).

+ cd /root/go/src/google.golang.org/api/
+ try3 go mod download
+ eval 'go mod download'
++ go mod download
+ ./internal/kokoro/vet.sh
+ [[ cloud-devrel/client-libraries/go/google-api-go-client/presubmit/latest-version != *\l\a\t\e\s\t\-\v\e\r\s\i\o\n* ]]
+ go mod tidy
+ tee /dev/stderr
+ read
+ git diff go.mod
diff --git a/go.mod b/go.mod
index 3e19e7de8b..b48b684637 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,8 @@
 module google.golang.org/api
 
-go 1.22
+go 1.22.7
+
+toolchain go1.23.5

@quartzmo
Copy link
Member Author

The dependency that forces 1.22.7 here is one that is under our control:

go: cloud.google.com/go/[email protected] requires [email protected], but 1.22 is requested

But unfortunately, that library has a dependency that is NOT under our control:

go: go.opentelemetry.io/auto/[email protected] requires [email protected], but 1.22 is requested

@matthewhartstonge
Copy link

matthewhartstonge commented Feb 11, 2025

I've created a minimal repro: https://github.com/matthewhartstonge/exp-gomod-toolchain-resolution

But yeah, the issue does seem to be the otel upstream dep.

Setting v1.22.0 should solve it, but may force downstream to set the patch.
But adding a 0 to the go directive is better than having to manage the toolchain directive.

@codyoss
Copy link
Member

codyoss commented Feb 12, 2025

To me this is a Go ecosystem class of issue. I think this feedback on managing go versions should likely be reported upstream to the Go project if it has not already.

@quartzmo
Copy link
Member Author

@codyoss golang/go#65847

@quartzmo quartzmo closed this Feb 12, 2025
@quartzmo quartzmo deleted the restore-go122 branch February 12, 2025 15:53
@quartzmo
Copy link
Member Author

@matthewhartstonge I'll investigate the possibility of setting v1.22.0 in our libraries separately. Closing this PR as it is currently a no-op.

@codyoss
Copy link
Member

codyoss commented Feb 12, 2025

@quartzmo That talks to the toolchain aspect, but the Go version part is likely a seperate and maybe even more contentious topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Minimum Virus": go.mod should support 1.2x without patch version, or 1.2x.0
3 participants