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

update to go1.22 #981

Merged
merged 11 commits into from
Apr 29, 2024
Merged

update to go1.22 #981

merged 11 commits into from
Apr 29, 2024

Conversation

wadey
Copy link
Member

@wadey wadey commented Sep 22, 2023

Since the first minor version update has already been released, we can probably feel comfortable updating to go1.21. This version now enforces that the go version on the system is compatible with the version specified in go.mod, so we can remove the old logic around checking the minimum version in the Makefile.

To improve forwards compatibility, Go 1.21 now reads the go line in a go.work or go.mod file as a strict minimum requirement: go 1.21.0 means that the workspace or module cannot be used with Go 1.20 or with Go 1.21rc1. This allows projects that depend on fixes made in later versions of Go to ensure that they are not used with earlier versions. It also gives better error reporting for projects that make use of new Go features: when the problem is that a newer Go version is needed, that problem is reported clearly, instead of attempting to build the code and printing errors about unresolved imports or syntax errors.

Also, switch off of go-version-file in the Github Actions, because it doesn't work great with the new go mod tidy format that go 1.22 does. See:

We have to make a few fixes for gvisor for go1.22 compatibility, I merged in the fixes from #1093 to resolve those.

Since the first minor version update has already been released, we can
probably feel comfortable updating to go1.21. This version now enforces
that the go version on the system is compatible with the version
specified in go.mod, so we can remove the old logic around checking the
minimum version in the Makefile.

- https://go.dev/doc/go1.21#tools

> To improve forwards compatibility, Go 1.21 now reads the go line in a go.work or go.mod file as a strict minimum requirement: go 1.21.0 means that the workspace or module cannot be used with Go 1.20 or with Go 1.21rc1. This allows projects that depend on fixes made in later versions of Go to ensure that they are not used with earlier versions. It also gives better error reporting for projects that make use of new Go features: when the problem is that a newer Go version is needed, that problem is reported clearly, instead of attempting to build the code and printing errors about unresolved imports or syntax errors.
@wadey wadey added this to the v1.8.0 milestone Sep 22, 2023
@brad-defined
Copy link
Collaborator

https://tip.golang.org/doc/go1.21#windows

As announced in the Go 1.20 release notes, Go 1.21 requires at least Windows 10 or Windows Server 2016; support for previous versions has been discontinued.

I think the only tricky thing about this is whether we want to drop support for older versions of Windows.

@wadey
Copy link
Member Author

wadey commented Sep 22, 2023

Let’s move this to Nebula 1.9 at least

@wadey wadey modified the milestones: v1.8.0, v1.9.0 Sep 22, 2023
@wadey wadey marked this pull request as draft October 27, 2023 12:43
@andypost
Copy link

andypost commented Mar 12, 2024

one more change except go 1.22 google/gvisor@64268c8

EDIT: attempting to patch to build on Alpinelinux https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/61981

@wadey
Copy link
Member Author

wadey commented Mar 29, 2024

EDIT: attempting to patch to build on Alpinelinux

@andypost why do you need to patch out CGO_ENABLED ? Nebula shouldn't require CGO for standard builds.

EDIT: ah I see, they use -buildmode=pie.

You should also be able to do make CGO_ENABLED=1 to build Nebula without patching the makefile. Just make your build() step:

make CGO_ENABLED=1 BUILD_ARGS="$GOFLAGS" BUILD_NUMBER="$pkgver" bin

@wadey wadey changed the title update to go1.21 update to go1.22 Apr 23, 2024
@wadey
Copy link
Member Author

wadey commented Apr 23, 2024

Updated to point to go1.22

@wadey wadey marked this pull request as ready for review April 23, 2024 17:53
@wadey wadey merged commit 3aca576 into master Apr 29, 2024
7 checks passed
@wadey wadey deleted the go1.21 branch April 29, 2024 20:44
@wadey wadey mentioned this pull request May 6, 2024
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants