I downloaded the 3.20 release source, extracted it, set the Go path and tried to build it but it’s not working for me. make deps completes fine but as soon as I want to build lxd itself I get go errors.
Are the instructions in the README still up-to-date?
root@dream:~/lxd-3.20# make
go get -t -v -d ./...
CC=cc go install -v -tags "libsqlite3" ./...
go install: no install location for directory /root/lxd-3.20/fuidshift outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxc outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxc-to-lxd outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxd outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxd-agent outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxd-benchmark outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxd-p2c outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/shared/generate outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/test/deps outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/test/macaroon-identity outside GOPATH
For more details see: 'go help gopath'
Makefile:18: recipe for target 'default' failed
make: *** [default] Error 1
To build an official release of LXD, download and extract a release tarball, and then set up GOPATH to point to the _dist directory inside it, which is configured to be used as a GOPATH and contains snapshots of all necessary sources.
The message you get, says that you did not do the GOPATH thing.
Sorry if I am a bit thick, but you did not explicilty say that you followed the doc advice to copy and paste the make deps output before running make and not just use the example in the doc.
When you run make, LXD tries to download the rest of the repositories and place them in /root/lxd-3.20/, which is obviously outside of $GOPATH. Hence the message.
Older versions of Go did not complain about this, and I believe that this is the reason why there is an error now.
A potential workaround would be to set two paths in $GOPATH, ~/go and the _dist one.
So that the repositories that LXD needs, can be placed properly in ~/go, as they can be used by other Go packages. Perhaps this is the missing bit from the documentation?
root@dream:~/lxd-3.20# echo $GOPATH
/root/lxd-3.20/_dist:/root/go:/root/lxd-3.20
root@dream:~/lxd-3.20# make
go get -t -v -d ./...
CC=cc go install -v -tags "libsqlite3" ./...
go install: no install location for directory /root/lxd-3.20/fuidshift outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /root/lxd-3.20/lxc outside GOPATH
...
I wonder if a switch to Go modules could fix this.
This question is a bit related so I’m asking it here.
If I want to use lxc 4.0 together with lxd 4.0 how would I build the former so the latter uses it?
I’m greeted by Error: Common start logic: Failed to start device "eth1": Requires liblxc has following API extensions: network_veth_router, network_l2proxy errors.
I stumbled upon this thread after getting the same error following the README’s instructions for building from release tarballs; the instructions are currently broken.