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

[Bug]: building for openSUSE fails with "unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)" #202

Closed
1 task done
johanneskastl opened this issue Oct 11, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@johanneskastl
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am packaging this very helpful utility for openSUSE. Currently it fails due to the following error:

[    4s] + go build -mod=vendor -buildmode=pie -o bin/helm-docs ./cmd/helm-docs
[    5s] # golang.org/x/sys/unix
[    5s] 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)
[    5s] vendor/golang.org/x/sys/unix/syscall_linux.go:1018:20: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[    5s] vendor/golang.org/x/sys/unix/syscall_linux.go:2297:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
[    5s] 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)
[    5s] 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)
[    5s] error: Bad exit status from /var/tmp/rpm-tmp.KYRhIP (%build)

The go.mod file still states go1.14 as required, I guess this should be increased to go1.17?

(Just changing that one line in the file during build solves this error, but then leads to error due to the vendoring necessary for building without internet connnectivity)

Expected Behavior

Successful build.

Reference Chart

None, no runtime problem.

Reference Template

No response

Environment

Building on openSUSE 64bit

Link to helm-docs Logs

No response

Further Information

No response

@johanneskastl johanneskastl added bug Something isn't working triage Issues that need to be triaged and categorized labels Oct 11, 2023
@Nepo26 Nepo26 removed the triage Issues that need to be triaged and categorized label Oct 12, 2023
@Nepo26
Copy link
Collaborator

Nepo26 commented Oct 12, 2023

Hi @johanneskastl,

I was able to reproduce the bug, and it seems like it was a bug in viper on older go versions, like shown in this issue.

So I will look further into it and see if 'go' really needs to be updated to 1.17.

Furthermore, thank you for the interest in the project! 😄

@Nepo26
Copy link
Collaborator

Nepo26 commented Oct 12, 2023

Testing it out, seems like only works with go 1.17 onward.
So I will make this change, but it will not be released right now. I'll triage some changes before the next release.


If anyone is interested in testing out, what I did was the following:

docker run -it golang:1.17 bash

git clone https://github.com/norwoodj/helm-docs

cd helm-docs

sed -i 's/go 1.14/go 1.17/g' go.mod

go mod tidy

go mod vendor

go build -mod=vendor -buildmode=pie -o bin/helm-docs ./cmd/helm-docs

@johanneskastl
Copy link
Author

Any news on this?

@johanneskastl
Copy link
Author

Fixed with 1.13.0 and go1.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
3 participants