Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 359625 - pkg-config mistracks build-time dependencies
Summary: pkg-config mistracks build-time dependencies
Status: RESOLVED DUPLICATE of bug 342393
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-20 17:08 UTC by Alexey Guzeev
Modified: 2011-03-20 17:12 UTC (History)
0 users

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


Attachments
the order-preserving content of /usr/lib64/pkgconfig directory on the system where pkgconfig fails (lslU,18.42 KB, text/plain)
2011-03-20 17:10 UTC, Alexey Guzeev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Guzeev 2011-03-20 17:08:23 UTC
On a perfectly working stable (non - ~amd64, with just fe user-level programs keyworded ~amd64) non-multilib system, where emerge -avtuDN world suggests nothing to do, and revdep-rebuild -p reports nothing to fix, it is impossible to use some libraries:

# pkg-config --cflags gtk+-2.0
Package dri2proto was not found in the pkg-config search path.
Perhaps you should add the directory containing `dri2proto.pc'
to the PKG_CONFIG_PATH environment variable
Package 'dri2proto', required by 'egl', not found

Yet on a mostly identical system, the same command works fine:

# pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/inclu
de -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14

gtk+-2.0 include files and libraries on both systems are the same, at the same places.

I can not think of any more significant difference between the systems rather than the order of files in the /usr/lib64/pkgconfig directory. Such order dependence should likely be classified as pkgconfig bug, but that's not the end of the story.

Reproducible: Always

Steps to Reproduce:
1. get an updated system, run 'emerge -avtuDN world'
2. 'emerge --depclean --with-bdeps n'. Among other packages, this will most certainly drop the x11-proto/dri2proto and x11-proto/glproto packages, as those are truly just compile-time dependencies.
3. run 'revdep-rebuild' just in case.
4. run 'emerge -avtuDN world' to ensure that the system still has all declared runtime dependencies installed.
5. Check /usr/lib/pkconfig files - you will certainly find there a few that still list the non-installed dri2proto as required libraries. Take a look into egl.pc for example.
6. Now if you are lucky (or should I say unlucky?) and [presumably] the files order in /usr/lib/pkgconfig is infortunate, then pkgconfig utility becomes rather useless for some innocent libraries like demonstrated above. If that happened, then you can do whatever shaman dances, including reboots - but till you install the dri2proto manually, you can not use gtk+-2.0 (in this example) for compiling new programs. The real problem is, how would you know if it is exactly the dri2proto that sorts things out? Then again, having auxilarly packages like dri2proto in /var/lib/portage/world is definitely an overkill.
Actual Results:  
As I already mentioned, the failing pkg-config is only part of the problem; typical user has no idea it exists at all. But then, if you try installing some package that uses ktk+-2.0 (I tried net-voip/ekiga and a bunch of others too), soon after compilation starts it aborts like this:

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/gmconf -I../../lib -I../../lib/engine/framework -I../../lib/engine/protocol -I../.. -I../.. -I../../lib/pixops -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -std=c99 -Os -march=core2 -pipe -fomit-frame-pointer -fweb -frename-registers -Wall -Wextra -Winit-self -Wswitch-default -Wswitch-enum -Wstrict-aliasing=2 -Wfloat-equal -Wshadow -c ../../lib/gui/gmconnectbutton.c  -fPIC -DPIC -o .libs/gmconnectbutton.o
../../lib/gui/gmdialog.c:45:21: error: gtk/gtk.h: No such file or directory
In file included from ../../lib/gui/gmlevelmeter.c:39:
../../lib/gui/gmlevelmeter.h:42:21: error: gdk/gdk.h: No such file or directory
../../lib/gui/gmlevelmeter.h:43:21: error: gtk/gtk.h: No such file or directory
In file included from ../../lib/gui/gmlevelmeter.c:39:
../../lib/gui/gmlevelmeter.h:57: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’

And inavoidably a hundred of irrelevant and totally confusing errors after this.

Expected Results:  
On a system where the pkg-config still gives data about gtk+-2.0 (despite the fact that the system also lacks dri2proto and glproto installed) compilation goes just fine:

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/gmconf -I../../lib -I../../lib/engine/framework -I../../lib/engine/protocol -I../.. -I../.. -I../../lib/pixops -pthread -I/usr/i
nclude/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include
/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -std=c99 -Os -march=nocona -pipe -fomit-frame-pointer -fweb -frename-registers -Wall -Wex
tra -Winit-self -Wswitch-default -Wswitch-enum -Wstrict-aliasing=2 -Wfloat-equal -Wshadow -c ../../lib/gui/gmlevelmeter.c  -fPIC -DPIC -o .libs/gmlevelmeter.o

Notice that here all the relevant libraries directories, in particular gtk+-2.0, are correctly listed for the compiler. This highlights yet another problem: when pkg-config stumbles upon something [irrelevant], there are no errors reported on the console or logs, but instead compilation tries to continue resulting in totally irrelevant errors that just distract you from the real problem and hide its source.

Same good compilation happens after you run 'emerge -avt1 dri2proto' (once again, how would even experienced user knew that!? ekiga package, for example, has nothing to do with the dri2proto package directly or at shallow levels of indirection).

I can think of only one method that would certainly resolve this particular issue: declare dri2proto and glproto as runtime dependencies of media-libs/mesa. Which sounds bad. Or, the other way around, media-libs/mesa should not mention dri2proto/glproto within /usr/lib64/pkgconfig/egl.pc (and overall - .pc files should ever mention only runtime dependencies, never compile-time ones, shouldn't they). But also I strongly suspect there is at least one bug with dev-util/pkgconfig-0.25-r2 itself, unfortunately I fail to word the problem precisely, so described here an overall picture.

Some information about the system where the problem persists follows.

=== emerge --info ===
Portage 2.1.9.25 (default/linux/amd64/10.0/no-multilib, gcc-4.4.5, glibc-2.11.3-r0, 2.6.37.3 x86_64)
=================================================================
System uname: Linux-2.6.37.3-x86_64-Intel-R-_Core-TM-_i7_CPU_860_@_2.80GHz-with-gentoo-1.12.14
Timestamp of tree: Wed, 09 Mar 2011 05:00:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r2, 3.1.3-r1
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -march=core2 -pipe -fomit-frame-pointer -fweb -frename-registers"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -march=core2 -pipe -fomit-frame-pointer -fweb -frename-registers"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://212.219.56.132/sites/www.ibiblio.org/gentoo/ http://mirror.datapipe.net/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://212.219.56.134/sites/www.ibiblio.org/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en ru eo"
MAKEOPTS="-j8 -l10.0"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/layman/java-overlay /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa amd64 berkdb bzip2 cdr cli cracklib crypt cxx dri dvd dvdr dvdread esd flac gdbm gif gpm gtk iconv java jpeg mad mikmod milter mmx modules motif mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pcre png pppd python readline sdl session sse sse2 ssl sysfs tcpd tiff truetype unicode videos vorbis xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ru eo" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
===
Comment 1 Alexey Guzeev 2011-03-20 17:10:19 UTC
Created attachment 266625 [details]
the order-preserving content of /usr/lib64/pkgconfig directory on the system where pkgconfig fails
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2011-03-20 17:12:51 UTC

*** This bug has been marked as a duplicate of bug 342393 ***