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

Fix go directive version in go.mod #5636

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

mauri870
Copy link
Contributor

@mauri870 mauri870 commented Jul 9, 2024

According to https://go.dev/issues/62278 a concrete go version has to include
the patch number. The project declares the version as 1.21 which is invalid and
will result in an error:

GOTOOLCHAIN="go1.20+auto" go1.21.5 mod tidy
go: downloading go1.21 (linux/amd64)
go: download go1.21 for linux/amd64: toolchain not available

Changed to 1.21.0 as this is the first actual release of go 1.21.

According to https://go.dev/issues/62278 a concrete go version has to include
the patch number. The project declares the version as 1.21 which is invalid and
will result in an error:

	GOTOOLCHAIN="go1.20+auto" go1.21.5 mod tidy
	go: downloading go1.21 (linux/amd64)
	go: download go1.21 for linux/amd64: toolchain not available

Changed to 1.21.0 as this is the first actual release of go 1.21.

Signed-off-by: Mauri de Souza Meneguzzo <[email protected]>
@mauri870 mauri870 requested a review from a team as a code owner July 9, 2024 22:16
@wallyqs
Copy link
Member

wallyqs commented Jul 11, 2024

Thanks for bringing this into our attention, this currently fails the building on Go 1.20 which we allow compiling for at the moment but would remove soon:

go: errors parsing go.mod:
./src/github.com/nats-io/nats-server/go.mod:3: invalid go version '1.21.0': must match format 1.23

One question, this would not mean that we are forcing the Go toolchain to be v1.21.0 correct?

@neilalexander
Copy link
Member

this currently fails the building on Go 1.20 which we allow compiling for at the moment

AFAIK we only support Go versions N and N-1, so that would be Go 1.22 and Go 1.21?

@derekcollison
Copy link
Member

What is the status of this PR?

@mauri870
Copy link
Contributor Author

Thanks for bringing this into our attention, this currently fails the building on Go 1.20 which we allow compiling for at the moment but would remove soon:

go: errors parsing go.mod:
./src/github.com/nats-io/nats-server/go.mod:3: invalid go version '1.21.0': must match format 1.23

One question, this would not mean that we are forcing the Go toolchain to be v1.21.0 correct?

Sorry for the delay in replying. No, this simply means that you need Go >= 1.21.0 to build. The 1.21.0 is just a placeholder; 1.21 is not a valid toolchain version. The first valid Go version for any release is vx.xx.0. You are correct that we would be dropping Go 1.20 with this change. In order to pin a specific toolchain version you have to use the go directive plus the toolchain directive.

@mauri870
Copy link
Contributor Author

What is the status of this PR?

I guess the main issue here is dropping support for Go 1.20, which is not maintained anymore since the release of 1.22 back in February.

@derekcollison
Copy link
Member

@wallyqs should we merge this?

@wallyqs
Copy link
Member

wallyqs commented Jul 23, 2024

Needs another PR first to remove Go 1.20 otherwise build won't be green, will send PR

@derekcollison derekcollison merged commit 562afd9 into nats-io:main Jul 23, 2024
1 of 2 checks passed
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.

4 participants