Skip to content

Use the Go 1.21.0 toolchain to build modules#31171

Closed
codingllama wants to merge 2 commits intomasterfrom
codingllama/go-toolchain
Closed

Use the Go 1.21.0 toolchain to build modules#31171
codingllama wants to merge 2 commits intomasterfrom
codingllama/go-toolchain

Conversation

@codingllama
Copy link
Copy Markdown
Contributor

This has (mostly) no practical effect as of right now, but it's a convenient way to bump the Go version for future patches/releases.

Done using go get toolchain@go1.21.

@codingllama
Copy link
Copy Markdown
Contributor Author

Dropped "Build CI Buildbox Images" changes in favor of #31173.

@codingllama
Copy link
Copy Markdown
Contributor Author

Also dropped api/go.mod toolchain line, as it won't build directly with Go 1.19 because of that.

We could keep the toolchain line and it should still be go-gettable, or at least that's what I'm led to believe, but then we'd have to change the "Build API Module" action to use Go 1.21+.

$ cd "$(mktemp -d)"
$ go1.19.12 mod init test
> go: creating new go.mod: module test

$ go1.19.12 get github.com/gravitational/teleport/api@3991c36
> go: added cloud.google.com/go/compute v1.20.1
> go: added cloud.google.com/go/compute/metadata v0.2.3
> go: added github.com/gravitational/teleport/api v0.0.0-20230829195104-3991c368e931

$ cat go.mod
> module test
> 
> go 1.19
> 
> require (
> 	cloud.google.com/go/compute v1.20.1 // indirect
> 	cloud.google.com/go/compute/metadata v0.2.3 // indirect
> 	github.com/gravitational/teleport/api v0.0.0-20230829195104-3991c368e931 // indirect
> )

@codingllama codingllama force-pushed the codingllama/go-toolchain branch from 370cc1b to b49cddd Compare August 29, 2023 21:34
Copy link
Copy Markdown
Contributor

@jakule jakule left a comment

Choose a reason for hiding this comment

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

CI is not happy

/__w/teleport/teleport/go.mod:5: unknown directive: toolchain

@codingllama
Copy link
Copy Markdown
Contributor Author

CI was running a pre-Go 1.21 image, see #31173. I didn't manually re-run all the failed jobs, but judging from Unit Tests I think we are good now.

Copy link
Copy Markdown
Contributor

@jakule jakule left a comment

Choose a reason for hiding this comment

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

If CI gods are happy, I'm not going to disagree with them.

Comment thread go.mod
@codingllama
Copy link
Copy Markdown
Contributor Author

This is obsolete since #31231.

@codingllama codingllama deleted the codingllama/go-toolchain branch August 31, 2023 18:30
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.

4 participants