peerswap
peerswap copied to clipboard
An unset GOPATH breaks peerswapd binary installation
It seems GOPATH is not set when installing go via a distro's package manager (at least on Ubuntu). When building peerswapd, there is an attempt to install the binary to the GOPATH but it seems to silently fail if GOPATH is not set. The binary is also not placed in out/, so I'm not sure where it ends up now.
user@armbox:~/builds/peerswap$ echo $GOPATH
user@armbox:~/builds/peerswap$ make lnd-release
# PeerSwap LND builds
rm -f out/peerswapd
rm -f out/pscli
go install -ldflags "-X main.GitCommit=c99c266c64ee8c353ce6d65fc804d54d5c5e376b" ./cmd/peerswaplnd/peerswapd
go install -ldflags "-X main.GitCommit=c99c266c64ee8c353ce6d65fc804d54d5c5e376b" ./cmd/peerswaplnd/pscli
user@armbox:~/builds/peerswap$ whereis peerswapd
peerswapd:
user@armbox:~/builds/peerswap$ ls out/
user@armbox:~/builds/peerswap$
I don't know golang conventions but IMO "build" and "install" should really be separate steps.
For me it ended up in /root/go/bin/ when building as root user for example (with no GOPATH set). I think it should go to ./out in that case.