volcano
volcano copied to clipboard
[darwin]go: cannot install cross-compiled binaries when GOBIN is set
Why GOBIN is set? It will also work via adding gobin dir to PATH env, I think.
What happened:
go: cannot install cross-compiled binaries when GOBIN is set
What you expected to happen:
Remove the GOBIN in makefile, and missed package can be installed when ever on linux or macos;
How to reproduce it (as minimally and precisely as possible):
- make controller-gen (on macos)
Anything else we need to know?:
- GOBIN is set in makefile
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
- go install works if no GOBIN env
Environment:
- Volcano Version: master branch
- Kubernetes version (use
kubectl version
): - Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
It is reasonable.
It is reasonable.
What's your meaning? I think it's better to leave GOBIN unset to be more compatible.
It is reasonable.
What's your meaning? I think it's better to leave GOBIN unset to be more compatible.
I agree with you.
In mac m1
➜ volcano git:(remove-vendor) ✗ make controller-gen
go: creating new go.mod: module tmp
go: cannot install cross-compiled binaries when GOBIN is set
make: *** [controller-gen] Error 1
when I delete set GOBIN in makefile
// delete
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
result :
➜ volcano git:(remove-vendor) make controller-gen
go: creating new go.mod: module tmp
@lowang-bh I agree with you.
@lowang-bh But i found when I delete the GOBIN,running make manifests
will error
➜ volcano git:(remove-vendor) ✗ make manifests
go: creating new go.mod: module tmp
/controller-gen "crd:crdVersions=v1,generateEmbeddedObjectMeta=true" paths="./vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1;./vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1;./vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1;./vendor/volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1" output:crd:artifacts:config=config/crd/bases
/bin/sh: /controller-gen: No such file or directory
make: *** [manifests] Error 127
@lowang-bh But i found when I delete the GOBIN,running
make manifests
will error➜ volcano git:(remove-vendor) ✗ make manifests go: creating new go.mod: module tmp /controller-gen "crd:crdVersions=v1,generateEmbeddedObjectMeta=true" paths="./vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1;./vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1;./vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1;./vendor/volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1" output:crd:artifacts:config=config/crd/bases /bin/sh: /controller-gen: No such file or directory make: *** [manifests] Error 127
Have you add go's bin path to os's PATH env?
Hello 👋 Looks like there was no activity on this issue for last 90 days. Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗 If there will be no activity for 60 days, this issue will be closed (we can always reopen an issue if we need!).
still need
/remove-lifecycle stale
/remove lifecycle/stale
This could be closed. @lowang-bh
/close
fixed by #3506
@lowang-bh: Closing this issue.
In response to this:
/close
fixed by #3506
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.