Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385561 - dev-libs/glib-2.30.0 and dev-libs/pkgconfig-0.26 depend on each other
Summary: dev-libs/glib-2.30.0 and dev-libs/pkgconfig-0.26 depend on each other
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 368301 374775 387811 389239 392017 415093 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-03 22:22 UTC by Bartosz Szreder
Modified: 2012-05-10 11:54 UTC (History)
7 users (show)

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


Attachments
build.log (build.log,7.88 KB, text/plain)
2011-10-04 02:47 UTC, Bartosz Szreder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartosz Szreder 2011-10-03 22:22:21 UTC
As of version 2.30.0 glib does not bundle pkg-config, but instead depends on external package and fails if pkg-config is not provided (most probably dev-libs/pkgconfig should be added as a dependency for dev-libs/glib). But the dev-libs/pkgconfig needs glib.h to compile, making this in fact a circular dependency. 

This is normally not a problem on a working Gentoo system - I've stumbled on it while installing Gentoo on a fresh machine.

Workaround: emerge "<dev-libs/glib-2.30"; emerge dev-libs/pkgconfig; emerge glib

Reproducible: Always

Steps to Reproduce:
1. emerge -C glib pkg-config
2. try "emerge =glib-2.30.0" or "emerge =pkgconfig-0.26"
Comment 1 Rafał Mużyło 2011-10-03 23:12:22 UTC
Any build logs of a failure ?

Cause you seem to be reading a different ebuild than the one in the tree.

As of now pkg-config 0.26 must depend on glib and as such glib *can't* depend on pkg-config in turn.

There are hacks in the glib ebuild that should allow glib to build in case pkg-config is not present yet.
Comment 2 Bartosz Szreder 2011-10-04 02:47:57 UTC
Created attachment 288735 [details]
build.log

I've got files with these checksums:

root@sysresccd /mnt/gentoo/usr/portage/dev-libs/glib % sha1sum glib-2.30.0.ebuild Manifest metadata.xml 
59934a4dd1fa86d8b067f0f64dc259dc5534a53f  glib-2.30.0.ebuild
3ae11a0d02fd967b61be4fa5c99a52d235f4b9fd  Manifest
db51ce81497f12112e03bb5812ea734e1e15b44e  metadata.xml

I'll try syncing the portage tree and reporting back.
Comment 3 Bartosz Szreder 2011-10-04 02:56:29 UTC
Syncing didn't fix the problem. I can reproduce this error consistently.
Comment 4 Rafał Mużyło 2011-10-04 09:45:45 UTC
OK, that's a different thing and there's a simple explanation:
libffi is a new dependency in 2.30 and somebody failed to update the hack in this regard.

On the other hand, I'm not sure the current hack is complete (regarding dbus) is complete.
Comment 5 Wojciech Porczyk 2011-10-04 13:24:21 UTC
I can confirm this bug. I was building fresh from stage3-i686, results were the same. This sequence worked:

emerge -1 \<dev-libs/glib-2.30
emerge -1 pkgconfig
emerge -1 dev-libs/glib
Comment 6 Pacho Ramos gentoo-dev 2011-10-04 18:56:38 UTC
Installing libffi should be enough as I can see in build.log, have you tried that instead?
Comment 7 Bartosz Szreder 2011-10-04 19:38:35 UTC
I've had libffi installed at the time of build failure so this is not a workaround.
Comment 8 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-10-04 23:30:36 UTC
I suppose we need the following ugly hack in src_configure() then:

	# Avoid circular depend with dev-util/pkgconfig
	if ! has_version dev-util/pkgconfig; then
		export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
		export DBUS1_LIBS="-ldbus-1"
		export ZLIB_CFLAGS=""
		export ZLIB_LIBS="-lz"
		# includes for dev-libs/libffi-X.Y.Z-rW are in /usr/lib/libffi-X.Y.Z/include
		export LIBFFI_CFLAGS="-I/usr/$(get_libdir)/$(best_version dev-libs/libffi | sed -e 's:dev-libs/::' -e 's:-r[0-9]\+$::')/include"
		export LIBFFI_LIBS="-lffi"
	fi

Note that this means we will have to depend on dev-libs/libffi, not virtual/libffi (no way to know where the virtual's includes are in advance).
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2011-10-05 09:07:23 UTC
The ZLIB should fallback and get detected properly without those lines. So drop them.

if ! has_version dev-util/pkgconfig; then
export LIBFFI_CFLAGS="-I$(realpath /usr/$(get_libdir)/libffi-*/include)"
export LIBFFI_LIBS="-lffi"
fi
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2011-10-05 09:08:24 UTC
grep ^includedir /usr/$(get_libdir)/pkgconfig/libffi.pc | sed -e "s:\${libdir}:/usr/$(get_libdir):" -e 's:.*=::'
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2011-10-05 09:09:14 UTC
The realpath version needs app-misc/realpath in DEPEND
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2011-10-06 08:52:10 UTC
+  06 Oct 2011; Samuli Suominen <ssuominen@gentoo.org> glib-2.30.0.ebuild:
+  export LIBFFI_CFLAGS and LIBFFI_LIBS if dev-util/pkgconfig is not installed
+  wrt #385561 by Bartosz Szreder
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2011-10-06 08:54:00 UTC
(In reply to comment #12)
> +  06 Oct 2011; Samuli Suominen <ssuominen@gentoo.org> glib-2.30.0.ebuild:
> +  export LIBFFI_CFLAGS and LIBFFI_LIBS if dev-util/pkgconfig is not installed
> +  wrt #385561 by Bartosz Szreder

http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/glib/glib-2.30.0.ebuild?r1=1.2&r2=1.3
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:48:39 UTC
*** Bug 368301 has been marked as a duplicate of this bug. ***
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:48:48 UTC
*** Bug 374775 has been marked as a duplicate of this bug. ***
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:49:08 UTC
*** Bug 415093 has been marked as a duplicate of this bug. ***
Comment 17 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:52:06 UTC
*** Bug 387811 has been marked as a duplicate of this bug. ***
Comment 18 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:52:21 UTC
*** Bug 392017 has been marked as a duplicate of this bug. ***
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:52:42 UTC
*** Bug 389239 has been marked as a duplicate of this bug. ***
Comment 20 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 11:54:36 UTC
For anyone ending up in this bug looking for a workaround:

If you have broken your dev-util/pkgconfig installation by uninstalling dev-libs/glib, you should recover your system like this:

# emerge -C dev-util/pkgconfig virtual/pkgconfig
# emerge -1 dev-util/pkgconfig