`make dev` should default to GOBIN
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
- set
GOPATHandGOBINenvironment variables - run
made dev - 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 - I suspect you may be able to achieve what you're after by making your own local adjustments to: the scripts/build.sh ?
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.
hey @eikenb is it possible to add to Makefile for example via make ... path-gobin? - just curious how it can be done.
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.