Bug 250902 - sys-apps/portage-2.2_rc17 fails with kde-live ebuilds
Bug#: 250902 Product:  Gentoo Linux Version: unspecified Platform: AMD64
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: dev-portage@gentoo.org Reported By: volkerarmin@googlemail.com
Component: Core system
URL: 
Summary: sys-apps/portage-2.2_rc17 fails with kde-live ebuilds
Keywords:  InSVN
Status Whiteboard: 
Opened: 2008-12-14 09:01 0000
Description:   Opened: 2008-12-14 09:01 0000
after compiling I get this error:
Installing app-misc/strigi-9999
Traceback (most recent call last): 
  File "/usr/bin/emerge", line 18, in <module>
    retval = _emerge.emerge_main()            
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 14543, in
emerge_main
    myopts, myaction, myfiles, spinner)                                         
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 13522, in
action_build
    retval = mergetask.merge()                                                  
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 9896, in merge       
    rval = self._merge()                                                        
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10138, in _merge     
    self._main_loop()                                                           
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10266, in _main_loop 
    self._poll_loop()                                                           
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 8823, in _poll_loop  
    handler(f, event)                                                           
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 2231, in
_output_handler
    self.wait()                                                                 
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1685, in wait        
    self._wait_hook()                                                           
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1758, in _wait_hook  
    self._exit_listener_stack.pop()(self)                                       
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 2664, in
_buildpkg_exit 
    self.wait()                                                                 
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1685, in wait        
    self._wait_hook()                                                           
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1758, in _wait_hook  
    self._exit_listener_stack.pop()(self)                                       
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1941, in
_default_final_exit
    return self.wait()                                                          
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1685, in wait
    self._wait_hook()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1758, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10118, in
_build_exit
    self._schedule()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 8736, in _schedule
    return self._schedule_tasks()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10285, in
_schedule_tasks
    if q.schedule():
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 8628, in schedule
    task.start()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 1666, in start
    self._start()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 3708, in _start
    self.returncode = self.merge.merge()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 3675, in merge
    retval = self._install_task.install()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 2703, in install
    rval = merge.execute()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 3045, in execute
    blockers=self.find_blockers)
  File "//usr/lib64/portage/pym/portage/__init__.py", line 6181, in merge
    mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "//usr/lib64/portage/pym/portage/dbapi/vartree.py", line 3850, in merge
    mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "//usr/lib64/portage/pym/portage/dbapi/vartree.py", line 3860, in _merge
    cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "//usr/lib64/portage/pym/portage/dbapi/vartree.py", line 3427, in
treewalk
    others_in_slot=others_in_slot)
  File "//usr/lib64/portage/pym/portage/dbapi/vartree.py", line 2051, in
unmerge
    cpv_lib_map = self._find_unused_preserved_libs()
  File "//usr/lib64/portage/pym/portage/dbapi/vartree.py", line 2722, in
_find_unused_preserved_libs
    cpv = path_cpv_map[obj]
KeyError: '/usr/kde/live/lib64/libkontactprivate.so.4.2.0'

yesterday it started after ~170 of 200 something ebuilds, today it started with
the first one, strigi - the error message is always the same. It happens with
preserved-libs feature turned on and off.

Reproducible: Always

Steps to Reproduce:
1. install kde-crazy overlay
2.emerge --keep-going @kde-live
3. wait




emerge --info
WARNING: One or more repositories have missing repo_name entries:

        /usr/local/portage/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.                  
 * Overlay eclasses override eclasses from PORTDIR:                
 *                                                                 
 *   '/usr/local/portage/layman/games/eclass/games.eclass'         
 *   '/usr/local/portage/layman/kde-crazy/eclass/kde4-base.eclass' 
 *   '/usr/local/portage/layman/kde-crazy/eclass/kde4-functions.eclass'
 *   '/usr/local/portage/layman/kde-crazy/eclass/kde4-meta.eclass'     
 *   '/usr/local/portage/layman/kde-crazy/eclass/qt4-build.eclass'     
 *                                                                     
 * It is best to avoid overriding eclasses from PORTDIR because it will
 * trigger invalidation of cached ebuild metadata that is distributed with
 * the portage tree. If you must override eclasses from PORTDIR then you  
 * are advised to add FEATURES="metadata-transfer" to /etc/make.conf and to
 * run `emerge --regen` after each time that you run `emerge --sync`. Set  
 * PORTAGE_ECLASS_WARNING_ENABLE="0" in /etc/make.conf if you would like to
 * disable this warning.                                                   
Error during set creation: Redefinition of set 'kde-4.2' (sections: 'usersets',
'kde sets')
Portage 2.2_rc17 (default/linux/amd64/2008.0/desktop, gcc-4.3.2,
glibc-2.9_p20081201-r0, 2.6.27.8r4_ehci x86_64)
=================================================================               
System uname:
Linux-2.6.27.8r4_ehci-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_6000+-with-glibc2.2.5 
Timestamp of tree: Sun, 14 Dec 2008 02:32:01 +0000                              
ccache version 2.4 [enabled]                                                    
app-shells/bash:     3.2_p48                                                    
dev-java/java-config: 1.3.7-r1, 2.1.6-r1                                        
dev-lang/python:     2.5.2-r8                                                   
dev-util/ccache:     2.4-r8                                                     
dev-util/cmake:      2.6.2                                                      
sys-apps/baselayout: 2.0.0                                                      
sys-apps/openrc:     0.3.0-r1                                                   
sys-apps/sandbox:    1.2.18.1-r3                                                
sys-devel/autoconf:  2.13, 2.63                                                 
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2                  
sys-devel/binutils:  2.19                                                       
sys-devel/gcc-config: 1.4.0-r4                                                  
sys-devel/libtool:   2.2.6a                                                     
virtual/os-headers:  2.6.27-r2                                                  
ACCEPT_KEYWORDS="amd64 ~amd64"                                                  
CBUILD="x86_64-pc-linux-gnu"                                                    
CFLAGS="-march=k8-sse3 -O2 -msse3 -pipe"                                        
CHOST="x86_64-pc-linux-gnu"                                                     
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/kde/4.1/env /usr/kde/4.1/share/config
/usr/kde/4.1/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config
/usr/kde/4.2/shutdown /usr/kde/live/env /usr/kde/live/share/config
/usr/kde/live/shutdown /usr/share/config"                    
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/
/etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release
/etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/
/etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo
/etc/udev/rules.d"                                                
CXXFLAGS="-march=k8-sse3 -O2 -msse3 -pipe"                                      
DISTDIR="/var/portage/distfiles"                                                
FEATURES="autoconfig buildpkg candy ccache distlocks fixpackages
metadata-transfer parallel-fetch protect-owned sandbox sfperms strict
unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"                    
LANG="de_DE@euro"                                                               
LC_ALL="de_DE@euro"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/usr/packages"
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="/var/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/games
/usr/local/portage/layman/kde-crazy /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip S3TC X Xaw3d a52 aac acpi addbookmarks aiglx aim aio
akode alias alsa altenburgcards amarok amd64 amr amrnb amrwb aotuv aqua_theme
archive asf athena audiofile autoreplace avahi bash-completion berkdb
binary-drivers bluetooth boost branding bzip2 cairo captury cdaudio cdda cddb
cdinstall cdparanoia cdr cdrom cdsound cegui clamav cli connectionstatus
consolekit contactnotes cracklib crypt css cups curl dbus depth32 dhcp dio divx
dnd double-precision dpmsdri dts dv dvb dvbplayer dvbsetup dvd dvdr dvdread eds
emboss emerald emovix emul-linux-x86 encode evo exif exiv2 expat exscalibar
extra-cardsets fame fasttrackffmpeg fftw file filter_default filter_legacy
filter_light firefox fits flac fontconfig foomaticdb fortran ftp gadu gammu gd
gdbm gif gimp gimpprint glitz glut glx gnokii gnutella gpgme gpm hal hddtemp
highlight history iconv icq icu id3 id3tag ieee1394 imagemagick inotify ipv6
irc irmc isdnlog jabber java javascript jce joystick jpeg jpeg2k kate kcal kde
kdecards kdeenablefinal kdehiddenvisibility kdepim kdeprefix kdm kexi kipi lame
lapack lcms lesstif libnotify libsamplerate libssh2 libwww lirc lm_sensors
logitech-mouse lzo lzw mad magic mailbox maildir maps matroska mbox
mdnsresponder-compat metric midi mikmod mime mixer mjpeg mmap mmx mmxext mng
mp3 mp4 mpeg mpeg2 mplayer msn mtp mudflap mule multilib musepack music
nano-syntax ncurses neXt nepomuk net network newspr ngui nls no-old-linux nocd
nosendmail nova nowin nowlistening npp nptl nptlonly nsplugin ntfs obex
offensive ogg ogg123 ogm openexr opengl openmp oscar pam paste64 pch pcre pda
pdf perl physfs pixmaps plasma player plugins png pnm posix ppds pppd python
qt3 qt3support qt4 quicktime rar readline recode reflection reiser4 reiserfs
remix resolvconf rogue rtc samba sametime sasl scanner scenarios schedule scsi
sdl sdl-image sdl-sound sdlaudio sendfile server session slp smp sms sndfile
sockets sounds spell spl sqlite sqlite3 srt sse sse-filters sse2 sse3 ssh ssl
ssse3 startup-notification statistics stats stencil-buffer stroke subp
subtitles svg sysfs sysvipc szip tcpd texteffect textures tga theora threads
threadsafe tiff timidity tk tomsfastmath toolbar tools transcode translator
truetype tv tv_check tv_combiner tv_pick_cgi type1 unicode unzip usb
userlocales utempter v4l v4l2 vcd videos visualization vorbis webdav webkit
webpresence wifi wireshark wmf wmp wxwindows x264 xanim xcb xcomposite xemacs
xext xface xine xml xorg xosd xpm xrandr xrender xscreensaver xskatcards xv
xvid xvmc yahoo yiff yv12 zip zlib zsh-completion zvbi" ALSA_CARDS="emu10k1"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file
hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multinull 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
dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache
filter headersinclude info log_config logio mem_cache mime mime_magic
negotiation rewrite setenvif speling status unique_id userdir usertrack
vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses
text" LINGUAS="de" LIRC_DEVICES="devinput" USERLAND="GNU" VIDEO_CARDS="vesa v4l
fglrx radeon radeonhd"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK,
PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

------- Comment #1 From Zac Medico 2008-12-14 18:34:35 0000 -------
It seems like symlinks to /usr/kde/live/lib64/libkontactprivate.so.4.2.0 got
preserved, but not the actual libkontactprivate.so.4.2.0 file itself. I'm not
sure why this would happen. Please post the output of the following commands:

  portageq list_preserved_libs /
  portageq owners / /usr/kde/live/lib64/libkontactprivate.so.4.2.0

FWIW, you should be able to avoid the KeyError if you manually removed
'/usr/kde/live/lib64/libkontactprivate.so.4.2.0'. It should be safe to remove
it since it doesn't seem to have any consumers.

------- Comment #2 From Volker Hemmann 2008-12-14 18:41:38 0000 -------
portageq list_preserved_libs /
kde-base/kontact-9999 /usr/kde/live/lib64/libkontactprivate.so

portageq owners / /usr/kde/live/lib64/libkontactprivate.so.4.2.0
kde-base/kontact-9999
        /usr/kde/live/lib64/libkontactprivate.so.4.2.0

------- Comment #3 From Zac Medico 2008-12-14 19:00:25 0000 -------
(In reply to comment #2)
> portageq list_preserved_libs /
> kde-base/kontact-9999 /usr/kde/live/lib64/libkontactprivate.so

Apparently the preservation code preserved the master link, and it needs to be
fixed to stop doing that. The correct workaround in this case is to remove
/var/lib/portage/preserved_libs_registry since it only has that one file
registered and so it doesn't hurt to remove the whole registry file.

------- Comment #4 From Volker Hemmann 2008-12-14 19:26:00 0000 -------
thanks for your help. Removing the file seemed to work (I moved away the lib
and its symlinks earlier because no app I use needs it anyway ...). 

------- Comment #5 From Zac Medico 2008-12-14 20:59:15 0000 -------
Created an attachment (id=175282) [details]
warn when necessary don't erroneously preserved master links

If this patch is saved as /tmp/masterlink.patch, then it can be applied as
follows:

  patch /usr/lib/portage/pym/portage/dbapi/vartree.py /tmp/masterlink.patch

(In reply to comment #4)
> thanks for your help. Removing the file seemed to work (I moved away the lib
> and its symlinks earlier because no app I use needs it anyway ...). 

Actually, you might want to reinstall that file since it might still be used
via dlopen even though nothing appears to link to it.

------- Comment #6 From Volker Hemmann 2008-12-14 21:04:30 0000 -------
yeah, after removing /var/lib/portage/preserved_libs_registry I moved the lib
and the symlinks back. I will try the patch later - I am updating kde-live at
the moment - 83 packages left. But I don't see how I can test it. The problem
seems to be solved after removing preserved_libs_registry.

------- Comment #7 From Zac Medico 2008-12-20 22:28:53 0000 -------
This is fixed in 2.2_rc18.

------- Comment #8 From Volker Hemmann 2008-12-20 22:39:28 0000 -------
thank you very much Zac.