Open ganto opened 5 years ago
When building lxd.spec with release 3.6 or later, the go test of github.com/lxc/lxd/shared/generate/db aborts with:
lxd.spec
github.com/lxc/lxd/shared/generate/db
+ go test -buildmode pie -compiler gc -v -tags libsqlite3 -ldflags ' -extldflags '\''-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\''' github.com/lxc/lxd/shared/generate/db === RUN TestPackages --- FAIL: TestPackages (0.00s) parse_test.go:25: Error Trace: parse_test.go:25 Error: Expected value not to be nil. Test: TestPackages === RUN TestParse --- PASS: TestParse (0.00s) FAIL FAIL github.com/lxc/lxd/shared/generate/db 0.008s
Error happens on Fedora 28 (golang-1.10.5-1.fc28.x86_64) and CentOS 7 (golang-1.11.2-3.el7.x86_64). Issue originally mentioned in https://github.com/ganto/copr-lxc3/issues/11#issuecomment-443419608
golang-1.10.5-1.fc28.x86_64
golang-1.11.2-3.el7.x86_64
When running the test against the release tarball with manually compiled bundled libraries, the error cannot be reproduced:
[vagrant@localhost ~]$ export GOPATH=/home/vagrant/lxd-3.8/dist [vagrant@localhost ~]$ export CGO_CFLAGS="-I/home/vagrant/lxd-3.8/dist/sqlite/ -I/home/vagrant/lxd-3.8/dist/dqlite/include/" [vagrant@localhost ~]$ export CGO_LDFLAGS="-L/home/vagrant/lxd-3.8/dist/sqlite/.libs/ -L/home/vagrant/lxd-3.8/dist/dqlite/.libs/" [vagrant@localhost ~]$ export LD_LIBRARY_PATH="/home/vagrant/lxd-3.8/dist/sqlite/.libs/:/home/vagrant/lxd-3.8/dist/dqlite/.libs/" [vagrant@localhost ~]$ go test -v github.com/lxc/lxd/shared/generate/db === RUN TestPackages --- PASS: TestPackages (0.04s) === RUN TestParse --- PASS: TestParse (0.00s) PASS ok github.com/lxc/lxd/shared/generate/db 0.060s
When building
lxd.spec
with release 3.6 or later, the go test ofgithub.com/lxc/lxd/shared/generate/db
aborts with:Error happens on Fedora 28 (
golang-1.10.5-1.fc28.x86_64
) and CentOS 7 (golang-1.11.2-3.el7.x86_64
). Issue originally mentioned in https://github.com/ganto/copr-lxc3/issues/11#issuecomment-443419608When running the test against the release tarball with manually compiled bundled libraries, the error cannot be reproduced: