artemiscloud / activemq-artemis-operator

Apache License 2.0
69 stars 63 forks source link

Error making the project with Ubuntu #824

Closed djarillo closed 8 months ago

djarillo commented 8 months ago

Using ubuntu for make the build (main bracnh) with these versions:

operator-sdk version: "v1.28.1", commit: "b05f6a56a176a98b7d92c4d4b36076967e0d77f7", kubernetes version: "1.26.0", go version: "go1.19.8", GOOS: "linux", GOARCH: "amd64"

I have this error:

` make build --debug

GNU Make 4.3 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Reading makefiles... Updating makefiles.... Updating goal targets.... File 'build' does not exist. File 'generate' does not exist. File 'controller-gen' does not exist. Prerequisite '/home/diego/github/activemq-artemis-operator/bin' is newer than target '/home/diego/github/activemq-artemis-operator/bin/controller-gen'. Must remake target '/home/diego/github/activemq-artemis-operator/bin/controller-gen'. test -s /home/diego/github/activemq-artemis-operator/bin/controller-gen && /home/diego/github/activemq-artemis-operator/bin/controller-gen --version | grep -q v0.11.2 || \ GOBIN=/home/diego/github/activemq-artemis-operator/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.2 Successfully remade target file '/home/diego/github/activemq-artemis-operator/bin/controller-gen'. Must remake target 'controller-gen'. Successfully remade target file 'controller-gen'. Must remake target 'generate'. /home/diego/github/activemq-artemis-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." 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=0xa08fcf]

goroutine 130 [running]: go/types.(Checker).handleBailout(0xc000979400, 0xc0015fbd40) /usr/local/go/src/go/types/check.go:367 +0x88 panic({0xbc3180?, 0x12aac20?}) /usr/local/go/src/runtime/panic.go:770 +0x132 go/types.(StdSizes).Sizeof(0x0, {0xdbb598, 0x12b33a0}) /usr/local/go/src/go/types/sizes.go:228 +0x30f go/types.(Config).sizeof(...) /usr/local/go/src/go/types/sizes.go:333 go/types.representableConst.func1({0xdbb598?, 0x12b33a0?}) /usr/local/go/src/go/types/const.go:76 +0x9e go/types.representableConst({0xdc1910, 0x127f520}, 0xc000979400, 0x12b33a0, 0x0) /usr/local/go/src/go/types/const.go:92 +0x192 go/types.(Checker).arrayLength(0xc000979400, {0xdbfc48, 0xc001545b00?}) /usr/local/go/src/go/types/typexpr.go:510 +0x2d3 go/types.(Checker).typInternal(0xc000979400, {0xdbe268, 0xc001546180}, 0xc0014fa190) /usr/local/go/src/go/types/typexpr.go:299 +0x49d go/types.(Checker).definedType(0xc000979400, {0xdbe268, 0xc001546180}, 0x10?) /usr/local/go/src/go/types/typexpr.go:180 +0x37 go/types.(Checker).typeDecl(0xc000979400, 0xc0014fa190, 0xc001543640, 0x0) /usr/local/go/src/go/types/decl.go:615 +0x44d go/types.(Checker).objDecl(0xc000979400, {0xdc6f20, 0xc0014fa190}, 0x0) /usr/local/go/src/go/types/decl.go:197 +0xa7f go/types.(Checker).packageObjects(0xc000979400) /usr/local/go/src/go/types/resolver.go:681 +0x425 go/types.(Checker).checkFiles(0xc000979400, {0xc001162c00, 0x3, 0x3}) /usr/local/go/src/go/types/check.go:408 +0x1a5 go/types.(Checker).Files(...) /usr/local/go/src/go/types/check.go:372 sigs.k8s.io/controller-tools/pkg/loader.(loader).typeCheck(0xc000378f90, 0xc0002ce560) /home/diego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.2/pkg/loader/loader.go:286 +0x36a sigs.k8s.io/controller-tools/pkg/loader.(Package).NeedTypesInfo(0xc0002ce560) /home/diego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.2/pkg/loader/loader.go:99 +0x39 sigs.k8s.io/controller-tools/pkg/loader.(TypeChecker).check(0xc000e433b0, 0xc0002ce560) /home/diego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.2/pkg/loader/refs.go:268 +0x2b7 sigs.k8s.io/controller-tools/pkg/loader.(TypeChecker).check.func1(0x20?) /home/diego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.2/pkg/loader/refs.go:262 +0x53 created by sigs.k8s.io/controller-tools/pkg/loader.(TypeChecker).check in goroutine 14 /home/diego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.2/pkg/loader/refs.go:260 +0x1c5 make: *** [Makefile:129: generate] Error 2 ` Can anyone help me with this error?

[!TIP] Vote this issue reacting with :+1: or :-1:

brusdev commented 8 months ago

@djarillo what go version are you using, could you try with go 1.20?

djarillo commented 8 months ago

@brusdev I have installed in my local this go version

go version go1.22.1 linux/amd64

But I don't know because "operator-sdk version" show the go version go1.19.8

Perhaps is necessary another operator-sdk version?

brusdev commented 8 months ago

@djarillo the operator-sdk is not required to execute make build, I suspect this is a backward compatibility issue of the go version. The current version supported by the operator is 1.20, see https://github.com/artemiscloud/activemq-artemis-operator/blob/main/go.mod#L3

djarillo commented 8 months ago

@brusdev Yes, with the go 1.20 version works fine.

Thanks!!