[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#885096: lintian could warn about use of /usr/lib/pkgconfig



Package: lintian
Version: 2.5.65
Severity: wishlist
User: helmutg@debian.org
Usertags: rebootstrap

Hi lintian maintainers and in particular Chris,

I have another wish for a lintian check and maybe Santa is gracious to
me this year. I've been filing ~1000 patches for cross build bugs and
that experience tends to turn into generic advise now. You've
implemented quite some checks for me and this one is very common as
well.

pkg-config maintainer Tollef Fog Heen decided that it was a good idea to
use different paths for cross pkg-config from native pkg-config. A
native pkg-config checks /usr/share/pkgconfig, /usr/lib/pkgconfig and
/usr/lib/<triplet>/pkgconfig. The cross wrapper skips
/usr/lib/pkgconfig. This behaviour is not entirely unreasonable:
/usr/lib/pkgconfig will contain .pc files from both build and host
architecture. Using them risks using a "wrong" .pc file. Unfortunately
that means that any .pc file placed in /usr/lib/pkgconfig is entirely
unusable to cross compilation. The solution is to move them to either
/usr/share/pkgconfig or /usr/lib/$(DEB_HOST_GNU_TYPE)/pkgconfig (aka
using multiarch paths).

Now the check is pretty simple. It fires whenever /usr/lib/pkgconfig is
part of a binary package. Estimating the number of flagged packages is
trivial as well: apt-file search /usr/lib/pkgconfig yields 700 files in
500 packages. Given the simplicity of the check, false positives are
next to impossible.

What is a bit more difficult is the advise that lintian is supposed to
give. In essence, this tag would ask packages to multiarchify. Just that
it is much weaker. This tag doesn't ask for adding Multi-Arch: same and
it also doesn't ask to pass a multiarch --libdir, all it needs is not
using /usr/lib/pkgconfig. In some cases, the simple solution is passing
a multiarch --libdir to configure (or simply bumping a debhelper compat
level and getting this flag automatically). In other cases a simple mv
is the quick solution. Let me try drafting this as a tag description:

    A .pc file is placed in /usr/lib/pkgconfig. The cross compilation
    wrapper of pkg-config does not search this directory and thus the
    .pc file is unavailable to cross compilation.

    Please move the .pc file to
    /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig. In the rare case that the
    .pc file is architecture-independent, it can be moved to
    /usr/share/pkgconfig instead. For autotools projects, a simple
    method is moving to a debhelper compat level of at least 9.

Do you also see value in this check? I suggest marking it as "certain"
and "normal".

Helmut


Reply to: