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

Build Broken after updating to go 1.22 #15

Closed
mikebaum opened this issue Apr 23, 2024 · 2 comments
Closed

Build Broken after updating to go 1.22 #15

mikebaum opened this issue Apr 23, 2024 · 2 comments

Comments

@mikebaum
Copy link
Contributor

When checking out the project and following the developer guide the make manifests target fails with the following error:

➜  benthos-captain git:(main) make manifests
test -s /Users/mbaum/code/benthos-captain/bin/controller-gen && /Users/mbaum/code/benthos-captain/bin/controller-gen --version | grep -q v0.12.0 || \
        GOBIN=/Users/mbaum/code/benthos-captain/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0
/Users/mbaum/code/benthos-captain/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
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=0x2 addr=0x0 pc=0x105462d14]

goroutine 25 [running]:
go/types.(*Checker).handleBailout(0x14000565200, 0x14001147d18)
        /opt/homebrew/opt/go/libexec/src/go/types/check.go:367 +0x9c
panic({0x10573d380?, 0x105cd3f10?})
        /opt/homebrew/opt/go/libexec/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x105807fb0, 0x105cdc6c0})
        /opt/homebrew/opt/go/libexec/src/go/types/sizes.go:228 +0x314
go/types.(*Config).sizeof(...)
        /opt/homebrew/opt/go/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x105807fb0?, 0x105cdc6c0?})
        /opt/homebrew/opt/go/libexec/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x10580e210, 0x105ca8800}, 0x14000565200, 0x105cdc6c0, 0x14001147468)
        /opt/homebrew/opt/go/libexec/src/go/types/const.go:92 +0x138
go/types.(*Checker).representation(0x14000565200, 0x14001152680, 0x105cdc6c0)
        /opt/homebrew/opt/go/libexec/src/go/types/const.go:256 +0x68
go/types.(*Checker).implicitTypeAndValue(0x14000565200, 0x14001152680, {0x105807fd8, 0x140002bae70})
        /opt/homebrew/opt/go/libexec/src/go/types/expr.go:375 +0x304
go/types.(*Checker).assignment(0x14000565200, 0x14001152680, {0x105807fd8, 0x140002bae70}, {0x10557b4a0, 0x14})
        /opt/homebrew/opt/go/libexec/src/go/types/assignments.go:52 +0x23c
go/types.(*Checker).initConst(0x14000565200, 0x140010ed500, 0x14001152680)
        /opt/homebrew/opt/go/libexec/src/go/types/assignments.go:126 +0x274
go/types.(*Checker).constDecl(0x14000565200, 0x140010ed500, {0x10580ab80, 0x14001274f00}, {0x10580ab80, 0x14001274f20}, 0x0)
        /opt/homebrew/opt/go/libexec/src/go/types/decl.go:490 +0x250
go/types.(*Checker).objDecl(0x14000565200, {0x105813360, 0x140010ed500}, 0x0)
        /opt/homebrew/opt/go/libexec/src/go/types/decl.go:191 +0x84c
go/types.(*Checker).packageObjects(0x14000565200)
        /opt/homebrew/opt/go/libexec/src/go/types/resolver.go:693 +0x468
go/types.(*Checker).checkFiles(0x14000565200, {0x14001910c00, 0x5, 0x5})
        /opt/homebrew/opt/go/libexec/src/go/types/check.go:408 +0x164
go/types.(*Checker).Files(...)
        /opt/homebrew/opt/go/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0x140002ef470, 0x14000234580)
        /Users/mbaum/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/loader.go:286 +0x2d8
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0x14000234580)
        /Users/mbaum/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/loader.go:99 +0x44
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0x14000469a70, 0x14000234580)
        /Users/mbaum/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:268 +0x304
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x0?)
        /Users/mbaum/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:262 +0x58
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 103
        /Users/mbaum/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:260 +0x230
make: *** [manifests] Error 2

Digging a bit this is related to the following upstream issue in the controller-tools project.

Updating the version of controller-tools to: v0.15.0 fixes the panic.

Additionally the main func no longer compiles as breaking changes were made to the controller-runtime ctrl.Options type.

@mikebaum
Copy link
Contributor Author

Created PR #16 to fix this issue.

@charlie-haley
Copy link
Member

Fixed in #16

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

No branches or pull requests

2 participants