volcano icon indicating copy to clipboard operation
volcano copied to clipboard

[darwin]go: cannot install cross-compiled binaries when GOBIN is set

Open lowang-bh opened this issue 1 year ago • 10 comments

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

image

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):

  1. make controller-gen (on macos)

Anything else we need to know?:

  1. GOBIN is set in makefile
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
  1. go install works if no GOBIN env image

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:

lowang-bh avatar Jun 05 '23 03:06 lowang-bh

It is reasonable.

hwdef avatar Jun 06 '23 08:06 hwdef

It is reasonable.

What's your meaning? I think it's better to leave GOBIN unset to be more compatible.

lowang-bh avatar Jun 07 '23 00:06 lowang-bh

It is reasonable.

What's your meaning? I think it's better to leave GOBIN unset to be more compatible.

I agree with you.

hwdef avatar Jun 07 '23 01:06 hwdef

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.

xiao-jay avatar Jun 14 '23 03:06 xiao-jay

@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

xiao-jay avatar Jun 14 '23 03:06 xiao-jay

@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?

lowang-bh avatar Jun 14 '23 04:06 lowang-bh

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!).

stale[bot] avatar Sep 17 '23 04:09 stale[bot]

still need

hwdef avatar Sep 17 '23 05:09 hwdef

/remove-lifecycle stale

lowang-bh avatar Sep 18 '23 02:09 lowang-bh

/remove lifecycle/stale

lowang-bh avatar Apr 06 '24 09:04 lowang-bh

This could be closed. @lowang-bh

yeahdongcn avatar Jun 07 '24 03:06 yeahdongcn

/close

fixed by #3506

lowang-bh avatar Jun 07 '24 04:06 lowang-bh

@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.

volcano-sh-bot avatar Jun 07 '24 04:06 volcano-sh-bot