Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639020 - app-emulation/lxd should have a hard DEPEND on dev-db/sqlite
Summary: app-emulation/lxd should have a hard DEPEND on dev-db/sqlite
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Erik Mackdanz
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-28 00:04 UTC by chirantan
Modified: 2018-05-21 01:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chirantan 2017-11-28 00:04:55 UTC
While porting lxd-2.18 to chromium os, I noticed that it fails to compile if sqlite is not listed in DEPENDs.  Specifically the error I'm seeing is:

# github.com/lxc/lxd/vendor/github.com/mattn/go-sqlite3
vendor/github.com/mattn/go-sqlite3/backup.go:12:10: fatal error: 'sqlite3.h' file not found
#include <sqlite3.h>
         ^~~~~~~~~~~
1 error generated.

Making dev-db/sqlite a hard DEPEND instead of making it conditional on USE=test fixed this problem for me.



Also since this is chromium os, I'm not sure how useful the emerge --info output would but I can post it if it would still be useful.
Comment 1 Virgil Dupras (RETIRED) gentoo-dev 2017-11-30 18:43:00 UTC
Thanks for this report. Seeing the "go-sqlite3" dependency, I was pretty much certain that you were right, so I tried installing LXD on a brand new sqlite-less system... and it worked.

When I look at https://github.com/mattn/go-sqlite3 , I see that sqlite3 is bundled with the package and that system sqlite3 is enabled only when we define USE_LIBSQLITE3

Do you know if this is defined on your system and if it is, for what reasons?
Comment 2 Virgil Dupras (RETIRED) gentoo-dev 2017-11-30 19:20:16 UTC
Maybe it's related to https://github.com/lxc/lxd/blob/c654f2a3a74876f88bd76c22b2c0149f20f6fa2c/Makefile#L12 ? A test for "sqlite3.h" yielding a false positive on your system?

But then again, if LXD prefers to link to the system sqlite if available, then maybe we should add it as a hard dependency...
Comment 3 chirantan 2017-11-30 21:05:21 UTC
I think you found it.  The emerge was failing when I was trying to cross-compile lxd for a target device.  Basically the situation I have is:

    /usr/include/sqlite3.h  <- exists
    /build/${BOARD}/usr/include/sqlite3.h  <- does not exist

All our compiler invocations are wrapped to add "-sysroot /build/${BOARD}", which is why directly testing if /usr/include/sqlite3.h exists returns true but trying to include it from an actual source file fails.

I guess the proper way to fix this is for lxd to try to include that header from a C file and only assume it exists if the C files compiles successfully.
Comment 4 Larry the Git Cow gentoo-dev 2018-05-21 01:29:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6be94961308bcbc954135412868267b9216f78e

commit d6be94961308bcbc954135412868267b9216f78e
Author:     Erik Mackdanz <stasibear@gentoo.org>
AuthorDate: 2018-05-21 01:26:29 +0000
Commit:     Erik Mackdanz <stasibear@gentoo.org>
CommitDate: 2018-05-21 01:26:29 +0000

    app-emulation/lxd: bump to 3.1
    
    Closes: https://bugs.gentoo.org/652846
    Closes: https://bugs.gentoo.org/639020
    Package-Manager: Portage-2.3.38, Repoman-2.3.9

 app-emulation/lxd/Manifest                         |   1 +
 .../lxd/files/ja-translation-newline.patch         |  11 ++
 app-emulation/lxd/lxd-3.1.ebuild                   | 180 +++++++++++++++++++++
 3 files changed, 192 insertions(+)