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

Bug 340973

Summary: sys-apps/portage-2.2_rc95 --- can't do 'emerge --depclean'
Product: Portage Development Reporter: Christian <christian+bgo>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: REGRESSION
Priority: High    
Version: 2.2   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 335925    
Attachments: debug.log (compressed
same debug output as before

Description Christian 2010-10-14 12:49:01 UTC
"emerge --depclean"
spits out this bug with portage-2.2-rc95:
>>> Checking for lib consumers...
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1625, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 2558, in
action_uninstall
    opts, action, valid_atoms, spinner, scheduler=sched._sched_iface)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 587, in
action_depclean
    myopts, action, args_set, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 1135, in calc_depclean
    priority=priority)[node]
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 2096, in
_select_atoms_from_graph
    return self._select_atoms_highest_available(*pargs, **kwargs)
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 2122, in
_select_atoms_highest_available
    myroot=root, trees=trees)
  File "/usr/lib64/portage/pym/portage/dep/dep_check.py", line 572, in
dep_check
    use_binaries=use_binaries, trees=trees)
  File "/usr/lib64/portage/pym/portage/dep/dep_check.py", line 237, in
dep_zapdeps
    use_binaries=use_binaries, trees=trees)
  File "/usr/lib64/portage/pym/portage/dep/dep_check.py", line 292, in
dep_zapdeps
    use_binaries=use_binaries, trees=trees)
  File "/usr/lib64/portage/pym/portage/dep/dep_check.py", line 305, in
dep_zapdeps
    if atom.blocker:
AttributeError: 'str' object has no attribute 'blocker'

Reproducible: Always

Steps to Reproduce:
1. emerge --depclean
2.
3.

Actual Results:  
AttributeError: 'str' object has no attribute 'blocker'

Expected Results:  
depclean works
Comment 1 Zac Medico gentoo-dev 2010-10-14 14:37:43 UTC
Please create debug.log like this and attach it:

  emerge --debug --depclean &> debug.log
Comment 2 Zac Medico gentoo-dev 2010-10-14 15:24:03 UTC
(In reply to comment #1)
> Please create debug.log like this and attach it:
> 
>   emerge --debug --depclean &> debug.log

Before you do that, please edit /usr/lib/portage/pym/portage/util/__init__.py and change "noiselimit = 0" to "noiselimit = 1" near the top of the file. Also, for safety you should add --pretend to the options shown above. 
Comment 3 Christian 2010-10-14 15:59:00 UTC
Created attachment 250573 [details]
debug.log (compressed
Comment 4 Zac Medico gentoo-dev 2010-10-14 17:09:21 UTC
This is what's triggering it:

['||', '||', '>=dev-games/ogre-1.7.1[boost-threads]', '>=dev-games/ogre-1.7.1[poco-threads]', '>=dev-games/ogre-1.7.1[tbb-threads]']

It seems to be a bug in the dependency parser. I'd like to know what the original dependency string looks like. This should find it:

  find /var/db/pkg -name '*DEPEND' | xargs grep dev-games/ogre
Comment 5 Christian 2010-10-14 17:27:07 UTC
find /var/db/pkg -name '*DEPEND' | xargs grep dev-games/ogre
/var/db/pkg/dev-games/gigi-9999-r1/DEPEND:dev-libs/boost:1.42 media-libs/freetype x11-libs/libX11 virtual/opengl media-libs/jpeg media-libs/tiff media-libs/libpng || ( >=dev-games/ogre-1.4.7[threads] || ( >=dev-games/ogre-1.7.1[boost-threads] >=dev-games/ogre-1.7.1[poco-threads] >=dev-games/ogre-1.7.1[tbb-threads] ) ) >=media-libs/libsdl-1.2 dev-util/pkgconfig >=dev-util/cmake-2.6.2-r1 >=sys-apps/findutils-4.4.0 dev-vcs/subversion net-misc/rsync
/var/db/pkg/dev-games/gigi-9999-r1/RDEPEND:dev-libs/boost:1.42 media-libs/freetype x11-libs/libX11 virtual/opengl media-libs/jpeg media-libs/tiff media-libs/libpng || ( >=dev-games/ogre-1.4.7[threads] || ( >=dev-games/ogre-1.7.1[boost-threads] >=dev-games/ogre-1.7.1[poco-threads] >=dev-games/ogre-1.7.1[tbb-threads] ) ) >=media-libs/libsdl-1.2


it seems to come from gigi-9999-r1, which I have from here http//bugs.gentoo.org/59212
But since freeorion isn't abel to emerge, I wanted to remove gigi with depclean. Removing gigi with "emerge -C gigi" works, and after that "emerge --depclean" is fine also. From this point it is fixed, but I don't think that an ugly ebuild should break emerge....
Comment 7 Christian 2010-10-14 18:20:10 UTC
ehh...
Is there anything I shall do with that?
Comment 9 Zac Medico gentoo-dev 2010-10-14 18:41:39 UTC
(In reply to comment #7)
> ehh...
> Is there anything I shall do with that?

If you can still reproduce it, you can test the patch. I already know it works though, because the test case reproduces the same state.
Comment 10 Christian 2010-10-14 18:55:54 UTC
Created attachment 250609 [details]
same debug output as before

I downloaded the new file, and installed gigi-9999-r1 again, but it still breaks depclean
Comment 11 Zac Medico gentoo-dev 2010-10-14 19:13:47 UTC
Thanks for testing again. I've got another test case here that produces similar breakage:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a9c68034155c91a1276a28e867451c50e9130892

For reference, the raw form of the troublesome dependency string from gigi-9999-r1 looks like this:

ogre? ( || ( >=dev-games/ogre-1.4.7[threads=] || ( threads? ( || ( >=dev-games/ogre-1.7.1[boost-threads] >=dev-games/ogre-1.7.1[poco-threads] >=dev-games/ogre-1.7.1[tbb-threads] ) ) !threads? ( >=dev-games/ogre-1.7.1[-boost-threads,-poco-threads,-tbb-threads] ) ) ) )
Comment 14 Christian 2010-10-15 11:15:17 UTC
unfortunately it now breaks some other dependencies:

Calculating dependencies                                  ... done!

emerge: there are no ebuilds built with USE flags to satisfy "app-crypt/pinentry[gtk]".
!!! One of the following packages is required to complete your request:
- app-crypt/pinentry-0.8.0-r1 (Change USE: +gtk)
(dependency required by "x11-plugins/enigmail-1.1.2-r3" [installed])
(dependency required by "mail-client/thunderbird-3.1.4" [installed])
(dependency required by "@selected")
(dependency required by "@world" [argument])


pnentry is installed with qt4 useflag:

app-crypt/pinentry
     Available versions:  0.8.0 (~)0.8.0-r1 {caps gtk ncurses qt4 static}
     Installed versions:  0.8.0-r1(11:22:33 26.09.2cat /var/db/pkg/x11-plugins/enigmail-1.1.2-r3/RDEPEND 
>=mail-client/thunderbird-3.1.1-r1[-system-sqlite] || ( ( >=app-crypt/gnupg-2.0 || ( app-crypt/pinentry[gtk] app-crypt/pinentry[qt4] ) ) =app-crypt/gnupg-1.4* ) x11-libs/libXrender x11-libs/libXt x11-libs/libXmu >=sys-libs/zlib-1.1.4 x11-libs/libXrender x11-libs/libXt x11-libs/libXmu virtual/jpeg dev-libs/expat app-arch/zip app-arch/unzip >=x11-libs/gtk+-2.8.6 >=dev-libs/glib-2.8.2 >=x11-libs/pango-1.10.1 >=dev-libs/libIDL-0.8.0 >=dev-libs/dbus-glib-0.72 >=x11-libs/startup-notification-0.8 !<x11-base/xorg-x11-6.7.0-r2 >=x11-libs/cairo-1.6.0010)(caps ncurses qt4 -gtk -static)

[I] app-crypt/pinentry
     Available versions:  0.8.0 (~)0.8.0-r1 {caps gtk ncurses qt4 static}
     Installed versions:  0.8.0-r1(11:22:33 26.09.2010)(caps ncurses qt4 -gtk -static)
     Homepage:            http://gnupg.org/aegypten2/index.html
     Description:         Collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol


which should be ok according to:
cat /var/db/pkg/x11-plugins/enigmail-1.1.2-r3/DEPEND 
>=mail-client/thunderbird-3.1.1-r1[-system-sqlite] x11-libs/libXrender x11-libs/libXt x11-libs/libXmu >=sys-libs/zlib-1.1.4 dev-util/pkgconfig x11-libs/libXrender x11-libs/libXt x11-libs/libXmu virtual/jpeg dev-libs/expat app-arch/zip app-arch/unzip >=x11-libs/gtk+-2.8.6 >=dev-libs/glib-2.8.2 >=x11-libs/pango-1.10.1 >=dev-libs/libIDL-0.8.0 >=dev-libs/dbus-glib-0.72 >=x11-libs/startup-notification-0.8 !<x11-base/xorg-x11-6.7.0-r2 >=x11-libs/cairo-1.6.0 app-arch/unzip =sys-devel/automake-1.11* =sys-devel/autoconf-2.1* >=sys-devel/libtool-2.2.6b

Do you need any more infos?
Comment 15 Christian 2010-10-15 11:21:33 UTC
oh, wait, this is true for this:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=32092a07dc506df221382ca49faba420c776f6f1

The other __init__.py doesn't break anything, but --depclean still doesn't work with gigi installed
Comment 16 Zac Medico gentoo-dev 2010-10-15 12:13:13 UTC
There's a new fix here, with a test case that's practically identical to the gigi-9999-r1 dependency:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=800cac59556d78af8a96c9bd266d33bb28ee9c0c
Comment 17 Christian 2010-10-15 12:17:24 UTC
*thumbs up*
finally it works. Nothing breaks and depclean is also fine now. Thank you, Great job!!
Comment 18 Zac Medico gentoo-dev 2010-10-16 03:38:42 UTC
(In reply to comment #17)
> *thumbs up*
> finally it works. Nothing breaks and depclean is also fine now. Thank you,
> Great job!!

Great, thanks for testing!

This is fixed in 2.1.9.19 and 2.2_rc97.