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

Support Go 1.22 and/or 1.23 #6788

Closed
stefanb opened this issue Jul 23, 2024 · 3 comments · Fixed by #6848
Closed

Support Go 1.22 and/or 1.23 #6788

stefanb opened this issue Jul 23, 2024 · 3 comments · Fixed by #6848
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code
Milestone

Comments

@stefanb
Copy link

stefanb commented Jul 23, 2024

Bug Report

What did you do?

Tried to build with Go 1.22 in

What did you expect to see?

Build to succeed.

What did you see instead? Under which circumstances?

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
  	panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa0df0f]
  
  goroutine 139 [running]:
  go/types.(*Checker).handleBailout(0xc0005e6a00, 0xc000057d40)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/check.go:367 +0x88
  panic({0xbc8860?, 0x12be880?})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/runtime/panic.go:770 +0x132
  go/types.(*StdSizes).Sizeof(0x0, {0xdc4618, 0x12c7080})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/sizes.go:228 +0x30f
  go/types.(*Config).sizeof(...)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/sizes.go:333
  go/types.representableConst.func1({0xdc4618?, 0x12c7080?})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/const.go:76 +0x9e
  go/types.representableConst({0xdcaa50, 0x[129](https://github.com/Homebrew/homebrew-core/actions/runs/10045258917/job/27762262326?pr=178113#step:4:130)1f60}, 0xc0005e6a00, 0x12c7080, 0x0)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/const.go:92 +0x192
  go/types.(*Checker).arrayLength(0xc0005e6a00, {0xdc8ca0, 0xc001510400?})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:510 +0x2d3
  go/types.(*Checker).typInternal(0xc0005e6a00, {0xdc72c0, 0xc0015094a0}, 0x0)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:299 +0x49d
  go/types.(*Checker).definedType(0xc0005e6a00, {0xdc72c0, 0xc0015094a0}, 0xc000057328?)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:180 +0x37
  go/types.(*Checker).varType(0xc0005e6a00, {0xdc72c0, 0xc0015094a0})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:145 +0x25
  go/types.(*Checker).structType(0xc0005e6a00, 0xc001522d80, 0xc001522d80?)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/struct.go:113 +0x19f
  go/types.(*Checker).typInternal(0xc0005e6a00, {0xdc7230, 0xc0015050c8}, 0xc001521400)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:316 +0x[134](https://github.com/Homebrew/homebrew-core/actions/runs/10045258917/job/27762262326?pr=178113#step:4:135)5
  go/types.(*Checker).definedType(0xc0005e6a00, {0xdc7230, 0xc0015050c8}, 0xc927a8?)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/typexpr.go:180 +0x37
  go/types.(*Checker).typeDecl(0xc0005e6a00, 0xc001521400, 0xc00150af00, 0x0)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/decl.go:615 +0x44d
  go/types.(*Checker).objDecl(0xc0005e6a00, {0xdd0000, 0xc001521400}, 0x0)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/decl.go:197 +0xa7f
  go/types.(*Checker).packageObjects(0xc0005e6a00)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/resolver.go:681 +0x425
  go/types.(*Checker).checkFiles(0xc0005e6a00, {0xc0011f57a0, 0x3, 0x3})
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/check.go:408 +0x1a5
  go/types.(*Checker).Files(...)
  	/home/linuxbrew/.linuxbrew/Cellar/go/1.22.5/libexec/src/go/types/check.go:372
  sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc00024b380, 0xc000364000)
  	/home/linuxbrew/.cache/Homebrew/go_mod_cache/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:286 +0x36a
  sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000364000)
  	/home/linuxbrew/.cache/Homebrew/go_mod_cache/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:99 +0x39
  sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000a54b40, 0xc000364000)
  	/home/linuxbrew/.cache/Homebrew/go_mod_cache/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:268 +0x2b7
  sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x68?)
  	/home/linuxbrew/.cache/Homebrew/go_mod_cache/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:262 +0x53
  created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 70
  	/home/linuxbrew/.cache/Homebrew/go_mod_cache/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:260 +0x1c5
  make: *** [Makefile:104: generate] Error 2
  Error: failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v4": exit status 2

in logs: https://github.com/Homebrew/homebrew-core/actions/runs/10045258917/job/27762262326?pr=178113

Environment

Operator type:

Kubernetes cluster type:

$ operator-sdk version

1.35.0

$ go version (if language is Go)

1.22

$ kubectl version

Possible Solution

Additional context

Go 1.21 is supported (=getting security fixes) only until August 2024 when Go 1.23 is expected to be released. It would make sense to add support for Go 1.22 or even 1.23 by then (Go 1.23 release candidates are already available).

@Neo2308
Copy link
Contributor

Neo2308 commented Jul 25, 2024

Relates: #6730

@acornett21 acornett21 added go Pull requests that update Go code dependencies Pull requests that update a dependency file labels Jul 25, 2024
@acornett21 acornett21 added this to the Backlog milestone Jul 25, 2024
@stefanb stefanb changed the title Support Go 1.22 (or 1.23) Support Go 1.22 and/or 1.23 Aug 18, 2024
@siggimoo
Copy link

siggimoo commented Oct 7, 2024

What's needed to make this happen? Go 1.21 is no longer supported by Google, and we're starting to run into dependency conflicts with other packages who have already upgraded.

@acornett21
Copy link
Contributor

Hi @siggimoo If you follow the below issue

the items in this list are what is needed to update to go 1.22. Right now a few folks are working on the ansible-operator-plugin to resolve dependency issues, move to UBI9, then we can update that to project to the next version of kubebuilder/k8s there. After that we can then work on migrating operator-sdk to the next version of kubebuilder/k8s/UBI9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code
Projects
None yet
4 participants