[OE-core] [PATCH v2] libsolv: don't pick up bundled db from host rpm

Max Krummenacher max.oss.09 at gmail.com
Mon May 22 21:32:18 UTC 2017


Hi Alex

Am Montag, den 22.05.2017, 16:08 +0300 schrieb Alexander Kanavin:
> On 05/19/2017 06:48 PM, Max Krummenacher wrote:
> > +   # check if rpm contains a bundled berkeley db
> > +-  CHECK_INCLUDE_FILE(rpm/db.h HAVE_RPM_DB_H)
> > ++  CHECK_LIBRARY_EXISTS(rpm.so db_create_rpmdb "" HAVE_RPM_DB_H)
> 
> Sorry Max, this is actually worse than the first version. HAVE_RPM_DB_H 
> has to accurately reflect the presence or absence of the header, as that 
> header is later included or not included depending on that. You cannot 
> set it based on checking some library.
Well, that is somewhat true.
The test explicitly tests that the header file is available, but then
implicitely assumes that when the header file is available no standalone
needs be linked.

Turning that assumption to explicitly test that rpm.so provides the db
functionality and from that assuming that rpm/db.h is available is IMHO
equally right or equally incomplete testing.

> So please either fix CHECK_INCLUDE_FILE, 
The reason why I didn't fix it as follows is that this would break
the test for the non native (target and nativesdk) case.

+  CHECK_INCLUDE_FILE(rpm/db.h HAVE_RPM_DB_H "-nostdinc")

For the non native case the OE rpm headers are actually stored in
the compiler's standard include path, so searching for rpm/db.h
with -nostdinc wouldn't pick up the file even if it would exist.

> 
> or let's revert to the first 
> version of the patch, as it at least doesn't introduce a new issue.
v1 unconditionally assumes that rpm is provided without a bundled db.
v2 tries to find out from the to be linked librpm.so if it db is bundled.
Both versions work for libsolv, libsolv-native, and nativesdk-libsolv.

I can send a v3 with either variant plus the rebase on top of the now
updated libsolv recipe.

What do you think?

Max




> Alex



More information about the Openembedded-core mailing list