nebula icon indicating copy to clipboard operation
nebula copied to clipboard

update to go1.22

Open wadey opened this issue 11 months ago • 5 comments

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.

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:

  • https://github.com/actions/setup-go/pull/460
  • https://github.com/actions/setup-go/issues/457

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

wadey avatar Sep 22 '23 13:09 wadey

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.

brad-defined avatar Sep 22 '23 14:09 brad-defined

Let’s move this to Nebula 1.9 at least

wadey avatar Sep 22 '23 14:09 wadey

one more change except go 1.22 https://github.com/google/gvisor/commit/64268c8483651ea83fc8783b9f1ec1bac0366b0a

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

andypost avatar Mar 12 '24 23:03 andypost

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 avatar Mar 29 '24 14:03 wadey

Updated to point to go1.22

wadey avatar Apr 23 '24 17:04 wadey