peerswap icon indicating copy to clipboard operation
peerswap copied to clipboard

An unset GOPATH breaks peerswapd binary installation

Open grubles opened this issue 3 years ago • 2 comments

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$ 

grubles avatar Oct 09 '22 21:10 grubles

I don't know golang conventions but IMO "build" and "install" should really be separate steps.

wtogami avatar Oct 09 '22 22:10 wtogami

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.

raucao avatar Dec 25 '22 10:12 raucao