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

Building kubecost fails due to go1.16 being used in go.mod #174

Closed
johanneskastl opened this issue Jul 11, 2024 · 10 comments · Fixed by #177
Closed

Building kubecost fails due to go1.16 being used in go.mod #174

johanneskastl opened this issue Jul 11, 2024 · 10 comments · Fixed by #177

Comments

@johanneskastl
Copy link
Contributor

I am trying to package kubectl-cost for openSUSE, but the build fails (with go1.22):

[    5s] + go build -mod=vendor -buildmode=pie -o bin/kubectl-cost ./cmd/kubectl-cost
[    6s] # golang.org/x/exp/constraints
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:13:2: embedding interface element ~int | ~int8 | ~int16 | ~int32 | ~int64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:20:2: embedding interface element ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:27:2: embedding interface element Signed | Unsigned requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:34:2: embedding interface element ~float32 | ~float64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:41:2: embedding interface element ~complex64 | ~complex128 requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    6s] vendor/golang.org/x/exp/constraints/constraints.go:49:2: embedding interface element Integer | Float | ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] # github.com/opencost/opencost/pkg/collections
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:13:20: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:13:22: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:39:25: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:39:27: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:46:23: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:46:25: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:46:32: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:57:10: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:66:10: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:139:19: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
[    9s] vendor/github.com/opencost/opencost/pkg/collections/blockingqueue.go:66:10: too many errors
[   12s] # golang.org/x/sys/unix
[   12s] vendor/golang.org/x/sys/unix/mremap.go:42:10: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   12s] vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   12s] vendor/golang.org/x/sys/unix/syscall_linux.go:1009:20: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   12s] vendor/golang.org/x/sys/unix/syscall_linux.go:2289:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   12s] vendor/golang.org/x/sys/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   12s] vendor/golang.org/x/sys/unix/sysvshm_unix.go:33:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[   86s] error: Bad exit status from /var/tmp/rpm-tmp.Jt70Nr (%build)

Could you increase the go version in go.mod to 1.18, please? That should be fairly common and should fix those errors...

Thanks in advance
Johannes

@AjayTripathy
Copy link
Contributor

AjayTripathy commented Jul 19, 2024

Hey @johanneskastl yes! thank you so much for this PR! Let me know if there's anything else we can do for you.

@johanneskastl
Copy link
Contributor Author

Thanks @AjayTripathy for merging this quickly. Could you cut a new release including those changes?

@AjayTripathy
Copy link
Contributor

Sorry for the late response; we'll get one out soon.

@kastl-ars
Copy link

How about that new release? Any ETA in sight?

@AjayTripathy
Copy link
Contributor

Hi @kastl-ars we will likely target one next week.

@AjayTripathy
Copy link
Contributor

@cliffcolvin let's clean up any CVEs and release on 1.16?

@AjayTripathy
Copy link
Contributor

This has been released

@kastl-ars
Copy link

This has been released

Sorry, but where was that released?

@AjayTripathy
Copy link
Contributor

Sorry for the late response @kastl-ars , it is here https://github.com/kubecost/kubectl-cost/releases/tag/v0.6.5

@kastl-ars
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants