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

openshift-goimports tool doesn't build on macOS #905

Closed
jpeach opened this issue Apr 14, 2022 · 8 comments · Fixed by #929
Closed

openshift-goimports tool doesn't build on macOS #905

jpeach opened this issue Apr 14, 2022 · 8 comments · Fixed by #929
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jpeach
Copy link
Contributor

jpeach commented Apr 14, 2022

Describe the bug

The build wraps various helper tools in build scripts that don't seem to work reliably in all build environments.

To Reproduce

$ make imports
GOBIN=/Users/jpeach/upstream/kcp/hack/tools ./hack/go-install.sh github.com/coreydaley/openshift-goimports openshift-goimports b92214262c6ce8598aefdee87aae6b8cf1a9fc86
go: creating new go.mod: module fake/mod
# golang.org/x/sys/unix
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.1_13.go:27:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.1_13.go:40:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
/Users/jpeach/go/pkg/mod/golang.org/x/sys@v0.0.0-20201109165425-215b40eba54c/unix/zsyscall_darwin_arm64.go:121:3: too many errors
make: *** [hack/tools/openshift-goimports-b92214262c6ce8598aefdee87aae6b8cf1a9fc86] Error 2

I think that if we switch to the tools pattern, I think that we can resolve this.

https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module

@jpeach jpeach added the kind/bug Categorizes issue or PR as related to a bug. label Apr 14, 2022
@jpeach jpeach changed the title Build tool helpers don't build openshift-goimports tool doesn't build on macOS Apr 14, 2022
@ncdc
Copy link
Member

ncdc commented Apr 18, 2022

What go version are you using?

@ncdc
Copy link
Member

ncdc commented Apr 18, 2022

We based the current setup on kubernetes-sigs/cluster-api#5569 (also see the referenced Slack thread in there).

@jpeach
Copy link
Contributor Author

jpeach commented Apr 18, 2022

What go version are you using?

1.18 on macOS M1. The problem is that the imports tool has a golang.org/x/sys that is too old.

@jpeach
Copy link
Contributor Author

jpeach commented Apr 18, 2022

We based the current setup on kubernetes-sigs/cluster-api#5569 (also see the referenced Slack thread in there).

Yeh hard to tell from that thread what problems they had. Maybe module dependency hell?

[vincepri](https://app.slack.com/team/UCD11GCET)  [6 months ago](https://kubernetes.slack.com/archives/C8TSNPY4T/p1635448081211400?thread_ts=1635440307.207400&cid=C8TSNPY4T)
Kustomize brings in lots of go mod dependencies, that's why we moved away from it

@ncdc
Copy link
Member

ncdc commented Apr 19, 2022

Are you able to downgrade to go 1.17? Because kcp is based on internals of Kubernetes, it's easiest for us to match the go version that Kubernetes is using.

@ncdc
Copy link
Member

ncdc commented Apr 19, 2022

Or hopefully the openshift-goimports PR will fix things

@jpeach
Copy link
Contributor Author

jpeach commented Apr 20, 2022

Or hopefully the openshift-goimports PR will fix things

yeh, let's upgrade when that lands

@jpeach jpeach closed this as completed Apr 20, 2022
@jpeach jpeach reopened this Apr 20, 2022
@ncdc
Copy link
Member

ncdc commented Apr 20, 2022

@jpeach we fixed the test infra to get your openshift-goimports PR to merge. Would you be willing to update kcp to use the latest commit from https://github.com/openshift-eng/openshift-goimports in the Makefile?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Done
2 participants