Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 189966

Summary: built_with_use fails for binary packages due to suboptimal merge order triggered by circular deps involving PDEPEND
Product: Portage Development Reporter: Allen Brooker (AllenJB) <gentoo-bugs>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS, REGRESSION
Priority: High    
Version: 2.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 198097    
Attachments: merge packages earlier when on PDEPEND is unsatisfied

Description Allen Brooker (AllenJB) 2007-08-23 20:19:36 UTC
While installing binary packages built on another machine, dev-php5/suhosin fails to install with the following message:
>>> Emerging (30 of 31) dev-php5/suhosin-0.9.18 to /
>>> Extracting info
 *
 * Using
 *
 *
 * Using
 *
 * Checking for required PHP feature(s) ...
 
!!! ERROR: dev-php5/suhosin-0.9.18 failed.
Call stack:
  ebuild.sh, line 1654:   Called dyn_setup
  ebuild.sh, line 714:   Called qa_call 'pkg_setup'
  ebuild.sh, line 44:   Called pkg_setup
  suhosin-0.9.18.ebuild, line 27:   Called require_php_with_use 'unicode'
  depend.php.eclass, line 203:   Called built_with_use '=' 'unicode'
  eutils.eclass, line 1681:   Called die
 
!!! Unable to resolve = to an installed package
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/log/portage/dev-php5:suhosin-0.9.18:20070823-200625.log'.
Comment 1 Allen Brooker (AllenJB) 2007-08-23 20:31:31 UTC
Just tried running the command again, and I've noticed that the cause appears to be portage trying to install suhosing BEFORE php, so it looks like a problem in dependency graph generation.

emerge -kN php

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge      ] dev-php5/suhosin-0.9.18
[binary  N    ]  dev-lang/php-5.2.4_pre200708051230-r2  USE="-adabas apache2 -bcmath -berkdb -birdstep bzip2 -calendar -cdb -cgi -cjk cli -concurrentmodphp crypt ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp gd -gd-external -gdbm -gmp hash iconv imap -inifile -interbase -iodbc ipv6 -java-external -json -kerberos -ldap -ldap-sasl -libedit -mcve mhash -msql -mssql mysql mysqli ncurses nls -oci8 -oci8-instant-client -odbc -pcntl pcre -pdo -pdo-external -pic posix -postgres -qdbm readline -recode reflection -sapdb session -sharedext -sharedmem simplexml -snmp -soap -sockets -solid -spell spl sqlite ssl suhosin -sybase -sybase-ct -sysvipc threads -tidy -tokenizer truetype unicode -wddx xml xmlreader -xmlrpc xmlwriter -xpm xsl -yaz zip -zip-external zlib"
[binary  N    ]   dev-php5/suhosin-0.9.18

Total: 2 packages (2 new), Size of downloads: 0 kB
Comment 2 Allen Brooker (AllenJB) 2007-08-23 20:35:42 UTC
emerge --info from target machine:
Portage 2.1.2.12 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.18xenucorona0 i686)
=================================================================
System uname: 2.6.18xenucorona0 i686 Intel(R) Xeon(R) CPU 5148 @ 2.33GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 23 Aug 2007 08:30:01 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe -mno-tls-direct-seg-refs"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask --alphabetical --verbose --tree"
FEATURES="buildpkg collision-protect distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv"
GENTOO_MIRRORS="         http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo         http://mirror.switch.ch/mirror/gentoo/         http://pandemonium.tiscali.de/pub/gentoo/     http://gentoo.virginmedia.com/ "
LANG="en_GB"
LC_ALL="en_GB.UTF-8"
LINGUAS="en_GB en"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl apache2 bash-completion bitmap-fonts bzip2 cli cracklib crypt cups dri fortran iconv ipv6 isdnlog ithreads midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl tcpd threads truetype-fonts type1-fonts unicode vhosts x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTDIR_OVERLAY
Comment 3 Allen Brooker (AllenJB) 2007-08-23 20:37:14 UTC
Side note: php and suhosin were last compiled and copied today, so what you see is the values used.

emerge --info from source machine:
Portage 2.1.2.12 (default-linux/x86/2006.1, gcc-4.1.2, glibc-2.5-r4, 2.6.16.28-xen-r2 i686)
=================================================================
System uname: 2.6.16.28-xen-r2 i686 Pentium III (Coppermine)
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 23 Aug 2007 08:30:01 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache1-php4/ext-active/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe -mno-tls-direct-seg-refs"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask --alphabetical --verbose --deep --tree"
FEATURES="buildpkg collision-protect distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv"
GENTOO_MIRRORS="http://gentoo.virginmedia.com/         http://mirror.switch.ch/mirror/gentoo/         http://pandemonium.tiscali.de/pub/gentoo/         http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo"
LANG="en_GB"
LC_ALL="en_GB.UTF8"
LINGUAS="en_GB en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl apache2 bash-completion bitmap-fonts bzip2 cli cracklib crypt cups dri fortran iconv ipv6 isdnlog ithreads midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl ppds pppd python readline reflection session spl ssl tcpd threads truetype-fonts type1-fonts unicode vhosts x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-08-23 20:42:47 UTC
(In reply to comment #1)
> Just tried running the command again, and I've noticed that the cause appears
> to be portage trying to install suhosing BEFORE php, so it looks like a problem
> in dependency graph generation.

Portage folks, enjoy. This DEPENDs on =dev-lang/php-5* via depend.php eclass (and dev-lang/php PDEPENDs on dev-php5/suhosin with USE=suhosin.

$ pquery --attr depends =dev-php5/suhosin-0.9.18
dev-php5/suhosin-0.9.18 depends="=dev-lang/php-5* =sys-devel/automake-1.10* >=sys-devel/autoconf-2.59 sys-devel/libtool >=sys-devel/m4-1.4.3 >=sys-devel/libtool-1.5.18"
Comment 5 Zac Medico gentoo-dev 2007-08-23 22:03:22 UTC
The issue here is that DEPEND is automatically ignored for binary packages. The build_with_use doesn't behave properly in this case. You can use --with-bdeps=y as a workaround until build_with_use can be replaced with USE deps (bug 174406).
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-08-23 22:19:49 UTC
Well, php outta here, nothing we could fix. Maybe --with-bdeps=y should be the default; shrug.
Comment 7 Zac Medico gentoo-dev 2007-08-23 23:04:44 UTC

*** This bug has been marked as a duplicate of bug 2272 ***
Comment 8 Zac Medico gentoo-dev 2007-11-02 03:17:55 UTC
We now have a merge order optimization in svn r8358 that helps for cases where there are circular dependencies involving PDEPEND, such as dev-lang/php PDEPENDs on dev-php5/suhosin which RDEPENDs on dev-lang/php. There is a similar relationship between the xorg-server and xf86-video-* packages which was causing trouble for the release engineering team.
Comment 9 Zac Medico gentoo-dev 2007-11-02 03:25:33 UTC
Created attachment 134986 [details, diff]
merge packages earlier when on PDEPEND is unsatisfied
Comment 10 Zac Medico gentoo-dev 2007-11-03 01:23:51 UTC
This has been released in 2.1.3.17.