Open ahmetb opened 7 years ago
Turns out it's trying to install to tar xvzf - -C "${GOPATH}/bin"
but my GOPATH is not set.
I'm glad you're not doing some sort of rm -rf ${GOPATH}/bin
at least. š
Thanks for investigating how this came about -
So, since Go 1.8 no longer requires setting a GOPATH, this is something we need to have a think about. As an alternative, we could extract ngrok to a local ./bin
directory instead of ${GOPATH}/bin
. Previously, if GOPATH wasn't set it would not be possible to build the application at all, hence why this hasn't been a problem in the past.
Am I seeing this right? Also why's compiling a go program so complicated?
Compiling kube-lego can be done using make build
. By running make
, you are also opting to run all tests. In this case, the kube-lego e2e tests depend upon ngrok in order to test obtaining a certificate.
@munnerz maybe we can make make build
not depend on the test
target. I was able to build it by disabling this.
Hmm - looking at the Makefile, it appears that's already the case. Are you sure you weren't typing make
instead of make build
? make
will by default call the all
target, which does include test
(as well as build
)
for ref.:
ā kube-lego git:(master) ā make build
rm -rf _test/
rm -rf _build/
mkdir _test/
mkdir _build/
echo 0.1.6-dev
0.1.6-dev
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-a -tags netgo \
-o _build/kube-lego-linux-amd64 \
-ldflags "-X main.AppGitState=dirty -X main.AppGitCommit=47ffbbd755247737b81de22abe6feb849716da00 -X main.AppVersion=0.1.6-dev"
My bad. I probably recall incorrectly. Feel free to close or change the title.
Not important enough to warrant its own ticket but relevant to this:
Go supports multiple paths in GOPATH
, such as /path1:/path2
which some people use to separate vendor packages (first path) from their own (second path). This seems to be valid according to `go help gopath.
This also breaks the ngrok
installation, (which maybe shouldn't be installed automatically, or should not be installed in the go's bin folder.)
/cc @superdecimal
I tried to build it myself with latest commits. I realized this software is trying to install things to my computer (macOS):
which ngrok || curl -sL "https://bin.equinox.io/a/mU8jSiqMekT/ngrok-2.1.14-linux-amd64.tar.gz" | tar xvzf - -C "/bin"
Am I seeing this right? Also why's compiling a go program so complicated?