Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 412391 - emerge --depclean reports bogus dependency resolution problem
Summary: emerge --depclean reports bogus dependency resolution problem
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 409383
  Show dependency tree
 
Reported: 2012-04-17 18:11 UTC by Nikos Chantziaras
Modified: 2012-04-23 00:00 UTC (History)
0 users

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


Attachments
Debug log (debug.log.bz2,207.97 KB, application/x-bzip2)
2012-04-18 13:57 UTC, Nikos Chantziaras
Details
/var/db/pkg/dev-libs/openssl-0.9.8u (openssl-0.9.8u.tar.bz2,23.57 KB, application/x-bzip2)
2012-04-18 18:11 UTC, Nikos Chantziaras
Details
emerge -puD --debug @world (emerge-puD.debug.log.bz2,139.72 KB, application/x-bzip2)
2012-04-19 02:47 UTC, Nikos Chantziaras
Details
add debug output in FakeVartree for --depclean (debug_fakevartree.patch,1.08 KB, text/plain)
2012-04-19 20:14 UTC, Zac Medico
Details
emerge --pretend --debug --depclean (debug.log.bz2,284.17 KB, application/x-bzip2)
2012-04-19 20:44 UTC, Nikos Chantziaras
Details
add debug output in FakeVartree for --depclean (debug_fakevartree2.patch,1.44 KB, patch)
2012-04-20 00:04 UTC, Zac Medico
Details | Diff
emerge --pretend --debug --depclean (debug.log.bz2,288.93 KB, application/x-bzip2)
2012-04-20 00:30 UTC, Nikos Chantziaras
Details
add debug output in FakeVartree for --depclean (debug_fakevartree3.patch,1.76 KB, patch)
2012-04-20 02:48 UTC, Zac Medico
Details | Diff
add debug output in FakeVartree for --depclean (debug_fakevartree3.patch,1.76 KB, patch)
2012-04-20 03:18 UTC, Zac Medico
Details | Diff
emerge --pretend --debug --depclean (debug.log.bz2,292.62 KB, application/x-bzip2)
2012-04-20 05:36 UTC, Nikos Chantziaras
Details
add debug output in FakeVartree for --depclean (debug_fakevartree4.patch,966 bytes, patch)
2012-04-20 07:06 UTC, Zac Medico
Details | Diff
emerge --pretend --debug --depclean (debug.log.bz2,208.62 KB, application/x-bzip2)
2012-04-20 07:20 UTC, Nikos Chantziaras
Details
add debug output in FakeVartree for --depclean (debug_fakevartree5.patch,1.51 KB, patch)
2012-04-20 16:42 UTC, Zac Medico
Details | Diff
emerge --pretend --debug --depclean (debug.log.bz2,224.30 KB, application/x-bzip2)
2012-04-20 23:31 UTC, Nikos Chantziaras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2012-04-17 18:11:51 UTC
Running emerge --depclean gives:

 * Dependencies could not be completely resolved due to
 * the following required packages not being installed:
 * 
 *   =dev-libs/openssl-0.9.8* pulled in by:
 *     app-emulation/vmware-workstation-8.0.2.591240
 * 
 *   dev-libs/openssl:0.9.8 pulled in by:
 *     www-client/google-chrome-19.0.1084.24_beta131971

Running "emerge --update --newuse --deep --with-bdeps=y @world" doesn't help ("Nothing to merge.")

I have unmerged and remerged openssl (both without and with "--oneshot"). No help there either.  So right now, depclean is completely non-functional on this system.

$ emerge -pv portage
[ebuild   R    ] sys-apps/portage-2.1.10.56  USE="(ipc) -build -doc -epydoc (-pypy1_8) -python2 -python3 (-selinux) -xattr" LINGUAS="-pl" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


$ emerge --info portage
Portage 2.1.10.56 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r3, 3.3.2-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.3.2-gentoo-x86_64-Intel-R-_Core-TM-_i5-2500K_CPU_@_3.30GHz-with-gentoo-2.1
Timestamp of tree: Tue, 17 Apr 2012 14:15:01 +0000
app-shells/bash:          4.2_p24
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.5
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2, 4.6.2
sys-devel/gcc-config:     1.7
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.3 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo nx proaudio science vmware interactive-fiction Local
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -mtune=native -march=native -O2 -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -mtune=native -march=native -O2 -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.ntua.gr/pub/linux/gentoo ftp://mirror.ovh.net/gentoo-distfiles ftp://distfiles.gentoo.org/pub/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common"
LINGUAS="en en_US"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/nx /var/lib/layman/pro-audio /var/lib/layman/science /var/lib/layman/vmware /var/lib/layman/interactive-fiction /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acpi aes-ni alsa amd64 audiofile avx bash-completion branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cxx dbus declarative dri dts dvd dvdr emboss encode exif fam fbcondecor flac gdbm gdu gif glitz gpm iconv imlib jpeg kde kipi lcdfilter lcms libsamplerate lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses nptl nptlonly nvidia offensive ogg opengl openmp pango pcre pdf pgo phonon plasma png policykit ppds pppd qt qt4 readline session spell sse sse2 sse3 sse4 sse4_1 ssl ssse3 startup-notification svg sysfs tcpd tiff truetype udev unicode usb vdpau vorbis webkit wxwidgets x264 xcb xcomposite xml xorg xulrunner xv xvid xvmc 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="plymouth" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="nothing" USERLAND="GNU" VIDEO_CARDS="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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/portage-2.1.10.56 was built with the following:
USE="(consolekit) (ipc) (multilib) (policykit) -build -doc -epydoc (-pypy1_8) -python2 -python3 (-selinux) -xattr" LINGUAS="-pl"
Comment 1 Michael Mol 2012-04-17 18:34:11 UTC
For reference, There's been some discussion of this on the gentoo-user mailing list. http://www.gossamer-threads.com/lists/gentoo/user/251998

(archives.gentoo.org hasn't gotten around to archiving that thread yet)
Comment 2 Zac Medico gentoo-dev 2012-04-17 19:53:14 UTC
Please post the output of the following commands:

  portageq match / =dev-libs/openssl-0.9.8\*
  portageq match / dev-libs/openssl:0.9.8
Comment 3 Nikos Chantziaras 2012-04-17 22:42:41 UTC
(In reply to comment #2)
> Please post the output of the following commands:
> 
>   portageq match / =dev-libs/openssl-0.9.8\*
>   portageq match / dev-libs/openssl:0.9.8

Both commands print:

dev-libs/openssl-0.9.8u
Comment 4 Zac Medico gentoo-dev 2012-04-18 01:21:02 UTC
Please attach a debug log, created as follows:

  emerge --pretend --debug --depclean &> debug.log
Comment 5 Nikos Chantziaras 2012-04-18 13:57:51 UTC
Created attachment 309411 [details]
Debug log
Comment 6 Zac Medico gentoo-dev 2012-04-18 18:01:24 UTC
Please attach a tarball of the /var/db/pkg/dev-libs/openssl-0.9.8u directory.
Comment 7 Nikos Chantziaras 2012-04-18 18:11:06 UTC
Created attachment 309435 [details]
/var/db/pkg/dev-libs/openssl-0.9.8u

(In reply to comment #6)
> Please attach a tarball of the /var/db/pkg/dev-libs/openssl-0.9.8u directory.

Here goes.
Comment 8 Zac Medico gentoo-dev 2012-04-18 19:36:20 UTC
(In reply to comment #7)
> Created attachment 309435 [details]
> /var/db/pkg/dev-libs/openssl-0.9.8u

Everything seems normal.

Please post the output of the following commands:

	portageq best_visible / installed =dev-libs/openssl-0.9.8\*
	portageq best_visible / installed dev-libs/openssl:0.9.8
Comment 9 Nikos Chantziaras 2012-04-18 19:40:47 UTC
(In reply to comment #8)
> Please post the output of the following commands:
> 
> 	portageq best_visible / installed =dev-libs/openssl-0.9.8\*
> 	portageq best_visible / installed dev-libs/openssl:0.9.8

Both say:

dev-libs/openssl-0.9.8u
Comment 10 Zac Medico gentoo-dev 2012-04-19 02:37:54 UTC
Strange.

Pleas post a debug log created as follows:

   emerge -puD --debug @world &> debug.log
Comment 11 Nikos Chantziaras 2012-04-19 02:47:54 UTC
Created attachment 309489 [details]
emerge -puD --debug @world
Comment 12 Zac Medico gentoo-dev 2012-04-19 05:34:52 UTC
(In reply to comment #11)
> Created attachment 309489 [details]
> emerge -puD --debug @world

This log appears to show proper behavior, which is interesting because --depclean uses mostly the same code for handling of installed packages.

I'll see about making a patch to provide some more debugging info.
Comment 13 Zac Medico gentoo-dev 2012-04-19 05:48:16 UTC
Do you have any special settings for openssl in /etc/portage? This command should show them:

    grep -r openssl /etc/portage
Comment 14 Nikos Chantziaras 2012-04-19 17:01:39 UTC
(In reply to comment #13)
>     grep -r openssl /etc/portage

Nope, not special settings.  The command is silent.
Comment 15 Zac Medico gentoo-dev 2012-04-19 20:14:09 UTC
Created attachment 309537 [details]
add debug output in FakeVartree for --depclean

Save as /tmp/debug_fakevartree.patch and apply as follows:

  patch /usr/lib/portage/pym/_emerge/FakeVartree.py /tmp/debug_fakevartree.patch

Then create another --depclean debug log:

  emerge --pretend --debug --depclean &> debug.log
Comment 16 Nikos Chantziaras 2012-04-19 20:44:45 UTC
Created attachment 309541 [details]
emerge --pretend --debug --depclean
Comment 17 Zac Medico gentoo-dev 2012-04-20 00:04:15 UTC
Created attachment 309551 [details, diff]
add debug output in FakeVartree for --depclean

Please reverse the previous patch and create a new debug log with this patch.
Comment 18 Nikos Chantziaras 2012-04-20 00:30:40 UTC
Created attachment 309553 [details]
emerge --pretend --debug --depclean
Comment 19 Zac Medico gentoo-dev 2012-04-20 02:48:02 UTC
Created attachment 309555 [details, diff]
add debug output in FakeVartree for --depclean

Please reverse the previous patch and create a new debug log with this patch.
Comment 20 Zac Medico gentoo-dev 2012-04-20 03:16:15 UTC
Comment on attachment 309555 [details, diff]
add debug output in FakeVartree for --depclean


diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index d4dbe97..904a7a5 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -72,6 +72,8 @@ class FakeVartree(vartree):
 		self._portdb = portdb
 		self._global_updates = None
 
+		self._debug = root_config.settings.get("PORTAGE_DEBUG") == "1"
+
 	@property
 	def root(self):
 		warnings.warn("The root attribute of "
@@ -88,7 +90,19 @@ class FakeVartree(vartree):
 		be accessed directly from the Package instance instead of via
 		aux_get().
 		"""
+		tracing = False
+		if self._debug:
+			if cpv in ('=dev-libs/openssl-0.9.8*', 'dev-libs/openssl:0.9.8'):
+				tracing = True
+				import portage.debug as portage_debug
+				portage_debug.set_trace(True)
 		matches = self._match(cpv, use_cache=use_cache)
+		if self._debug:
+			portage.util.writemsg("FakeVartree._match_wrapper('%s'): %s\n" %
+				(cpv, matches), noiselevel=-1)
+			if tracing:
+				portage_debug.set_trace(False)
+
 		for cpv in matches:
 			if cpv in self._aux_get_history:
 				continue
@@ -199,6 +213,10 @@ class FakeVartree(vartree):
 			if pkg is None:
 				pkg = self._pkg(cpv)
 
+			if self._debug:
+				portage.util.writemsg("FakeVartree._sync: %s slot_atom: %s counter: %s\n" %
+					(pkg, pkg.slot_atom, pkg.counter), noiselevel=-1)
+
 			other_counter = slot_counters.get(pkg.slot_atom)
 			if other_counter is not None:
 				if other_counter > pkg.counter:
@@ -207,6 +225,11 @@ class FakeVartree(vartree):
 			slot_counters[pkg.slot_atom] = pkg.counter
 			pkg_vardb.cpv_inject(pkg)
 
+		if self._debug:
+			portage.util.writemsg("FakeVartree._sync:\n", noiselevel=-1)
+			for cpv in sorted(pkg_vardb.cpv_all()):
+				portage.util.writemsg("\t%s\n" % (cpv,), noiselevel=-1)
+
 		real_vardb.flush_cache()
 
 	def _pkg(self, cpv):
Comment 21 Zac Medico gentoo-dev 2012-04-20 03:18:20 UTC
Created attachment 309557 [details, diff]
add debug output in FakeVartree for --depclean

Please reverse the previous patch and create a new debug log with this patch.
Comment 22 Nikos Chantziaras 2012-04-20 05:36:36 UTC
Created attachment 309583 [details]
emerge --pretend --debug --depclean
Comment 23 Zac Medico gentoo-dev 2012-04-20 06:29:54 UTC
(In reply to comment #22)
> Created attachment 309583 [details]
> emerge --pretend --debug --depclean

It looks like you don't have that latest patch applied. The latest patch has portage_debug.set_trace(True), which will produce additional output.
Comment 24 Zac Medico gentoo-dev 2012-04-20 06:32:07 UTC
(In reply to comment #23)
> (In reply to comment #22)
> > Created attachment 309583 [details]
> > emerge --pretend --debug --depclean
> 
> It looks like you don't have that latest patch applied. The latest patch has
> portage_debug.set_trace(True), which will produce additional output.

Actually, the log looks good. I had confused it with another log downloaded earlier.
Comment 25 Zac Medico gentoo-dev 2012-04-20 07:06:32 UTC
Created attachment 309589 [details, diff]
add debug output in FakeVartree for --depclean

Please reverse the previous patch and create a new debug log with this patch.
Comment 26 Nikos Chantziaras 2012-04-20 07:20:50 UTC
Created attachment 309595 [details]
emerge --pretend --debug --depclean
Comment 27 Zac Medico gentoo-dev 2012-04-20 16:42:12 UTC
Created attachment 309637 [details, diff]
add debug output in FakeVartree for --depclean

Please reverse the previous patch and create a new debug log with this patch.
Comment 28 Nikos Chantziaras 2012-04-20 23:31:48 UTC
Created attachment 309687 [details]
emerge --pretend --debug --depclean
Comment 29 Zac Medico gentoo-dev 2012-04-21 05:43:02 UTC
The bug is captured on this line of the debug output:

portage/dbapi/__init__.py line=177 name=_match_use event=return value=False locals={'atom': u'dev-libs/openssl', 'x': u'static-libs', 'self': <_emerge.FakeVartree.FakeVardbapi object at 0x4230390>, 'iuse': frozenset([u'zlib', u'sse2', u'kerberos', u'test', u'bindist', u'gmp']), 'iuse_implicit_match': <portage.package.ebuild.config._iuse_implicit_match_cache object at 0x24fedd0>, 'cpv': u'dev-libs/openssl-0.9.8v', 'metadata': {'SLOT': u'0.9.8', 'IUSE': u'bindist gmp kerberos sse2 test zlib', 'USE': u'amd64 consolekit elibc_glibc kernel_linux multilib policykit sse2 userland_GNU zlib'}}

The PackageVirtualDbapi class caches the result from a match for dev-libs/openssl[static-libs?], and inappropriately re-uses the result for cp_list calls. It's similar to the bug fixed by this patch:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5438bb29c996d777b6343515995176912a7c137f
Comment 31 Nikos Chantziaras 2012-04-21 07:39:29 UTC
I've put the patch in /etc/portage/patches/sys-apps/portage/ and emerged portage.  emerge --depclean now works correctly.

I'm closing this as fixed.  Thanks Zac for your persistence in tracking this one down :-)
Comment 32 Zac Medico gentoo-dev 2012-04-23 00:00:38 UTC
This is fixed in 2.1.10.57 and 2.2.0_alpha101.