vault icon indicating copy to clipboard operation
vault copied to clipboard

`make dev` should default to GOBIN

Open eikenb opened this issue 6 years ago • 4 comments

Currently when you run made dev it tries to copy the binary to the bin/ directory in the first GOPATH entry (cudos for handling GOPATH as a list). I'd like it to default to $GOBIN if set, basically the same behavior as go install.

Maybe not a bug, but seemed like the closest category.

To Reproduce

  1. set GOPATH and GOBIN environment variables
  2. run made dev
  3. vault binary is installed to bin/ under first GOPATH entry

Expected behavior Vault binary installed in $GOBIN

Environment: Vault 1.1.3 Debian 10 (buster)/Linux

Not sure if this is really a bug, but seemed like the closest category.

Thanks.

eikenb avatar Jul 22 '19 22:07 eikenb

@eikenb - I suspect you may be able to achieve what you're after by making your own local adjustments to: the scripts/build.sh ?

aphorise avatar Aug 23 '20 20:08 aphorise

Thanks for the suggestion @aphorise, but getting it to work is not the problem (ie. I can work around it). The main problems is that GOPATH is a colon separated list of paths and Vault script uses it as if it were always set to a single entry. This is a bug. Presumably this works for the CI system and such, but it would break on many/most workstations. I suggested using GOBIN here as it is the cleanest fix.

eikenb avatar Aug 24 '20 17:08 eikenb

hey @eikenb is it possible to add to Makefile for example via make ... path-gobin? - just curious how it can be done.

aphorise avatar Sep 05 '22 14:09 aphorise

If you have GOPATH set, you can set GOBIN based on GOPATH with any POSIX compatible shell with: GOBIN=${GOPATH%%:*} (that strips off everything after the first path delimiter :).

Once GOBIN is set, go install will install to that path.

If that doesn't answer your question please let me know. Thanks for considering this.

eikenb avatar Sep 06 '22 19:09 eikenb