Closed geerlingguy closed 4 years ago
Ah, I think I was a bit confused...
If I run $ go env GOPATH
it output /home/myuser/go
.
However, the $GOPATH
env var was not set, which the Makefile uses. So I had to also export GOPATH=/home/myuser/go
so the environment variable was set. (Also note that you can't set GOPATH=~/go
because you get the error:
go: GOPATH entry cannot start with shell metacharacter '~'
Weird because in the makefile, it's like:
GOPATH ?= `$(pwd)`
JSONNET_BIN := $(GOPATH)/bin/jsonnet
JB_BINARY := $(GOPATH)/bin/jb
It should install in your GOPATH if it's already defined otherwise it would install into current dir (pwd).
Yes, it must be an absolute path. I just tested without the GOPATH variable and it really fails. I will change the Makefile to warn the user to have the GOPATH set.
Did it work this way?
That's weird, $GOPATH
was definitely empty (confirmed with an echo
and env
), and go installed the bins in ~/go/bin
.
My workaround worked fine, and right now I don't have time to dig in any deeper (already burned about 4 more hours on this task than I planned; this repo has saved me a lot of time ;).
Feel free to close this issue, and hopefully if someone else who fights with GOPATH and env vars like I do so often has the same problem, Google will lead them here :)
Nice! Glad it helped. I'll take a look into this to avoid further problems like this :)
Fixed by a6a1133ec5cdbe464b31b83ca35f1ed713e0a2fc. Can you check?
@carlosedp Testing now.
It looks like that worked! I dropped all my workarounds and it's picking up the GOPATH correctly.
One weird thing is all the manifests are there, but completely empty after I make vendor && make
... not sure what's up with that (I'm running Go 1.11), but if I determine it's something not my fault I may open a separate issue. (This issue occurred prior to this commit though, so this commit didn't introduce a regression there.)
The fix worked for the GOPATH, but I did find another issue and I'll open up a separate issue for it (it's unrelated).
When I try running
make vendor
after customizing myvars.jsonnet
file, I keep getting:It seems like the path
/bin/jb
is hardcoded, but when it installsjsonnet-bundler
it is running with my local GOPATH, which is~/go
, sojb
is installed in~/go/bin/jb
and not in the global/bin
dir.Can the makefile be updated to work with just calling
jb
instead? I have added the go bin path to my user's$PATH
as well, but since the/bin/jb
location is hardcoded, I have to manually add a symlink or install as root, which is a little strange.