lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.07k forks source link

GOCC variable should be employed in makefiles #6489

Open paboum opened 2 years ago

paboum commented 2 years ago

I compile lnd on raspberry pi which by default has no go>=1.17.

I installed go.1.18.1 with go get golang.org/dl/go1.18.1 go1.18.1 download

But now my go binary is go1.18.1, not go. So the lnd makefiles fail.

I had to work around with: sed -i "s/go /go1.18.1 /g" Makefile

But I would much more prefer to do: GOCC=go1.18.1 make install, just as in ipfs makefiles.

guggero commented 2 years ago

I'm willing to review a PR to add this. But how about just doing alias go=go1.18.1 to fix this across many other projects that likely don't support this?

paboum commented 2 years ago

But how about just doing alias go=go1.18.1 to fix this across many other projects that likely don't support this?

That would be a python way of resolving things, and go only inherits after C, Alef and Oberon-2 (which in turn inherits after Modula-2).

Please also note the builtin gnu make rule set, it may follow the tradition and introduce $(GOC) (not $(GOCC) however): https://www.gnu.org/software/make/manual/make.html#Catalogue-of-Rules