Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354787 - sys-apps/portage- - emerge does not reinstall lower SLOTs when USE flags have changed
Summary: sys-apps/portage- - emerge does not reinstall lower SLOTs when USE fl...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
Depends on:
Reported: 2011-02-13 20:53 UTC by Waldemar Szostak
Modified: 2022-10-20 02:43 UTC (History)
0 users

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

emerge -pvNDu world --with-bdeps=y --backtrack=0 --debug &> debug.log (,228.38 KB, text/plain)
2011-02-16 16:20 UTC, Waldemar Szostak
emerge -pv --depclean --debug &> depclean.log (,217.59 KB, text/plain)
2011-02-16 16:41 UTC, Waldemar Szostak

Note You need to log in before you can comment on or make changes to this bug.
Description Waldemar Szostak 2011-02-13 20:53:54 UTC
When there are several versions of the same package, portage doesn't check for all of them (probably only for the latest one) if the USE flags have changed.

Example: I've had a few versions of python (2.6, 2.7, 3.1). At some point I realized I need one extra flag enabled ('threads'), so I enabled it and ran 'emerge -avNDu world'. However, portage did not report 2.6 to have this flag missing (in other words - list it for re-compilation).

See also Bug 354629.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 15:14:52 UTC
Please paste the output of `emerge --info sys-apps/portage' in a comment.
Comment 2 Zac Medico gentoo-dev 2011-02-15 19:38:39 UTC
(In reply to comment #0)
> When there are several versions of the same package, portage doesn't check for
> all of them (probably only for the latest one) if the USE flags have changed.

Generally, this means that the older versions would be removed by emerge --depclean. Please check the output of emerge --pretend --depclean.
Comment 3 Zac Medico gentoo-dev 2011-02-15 19:39:56 UTC
I should also note that in some cases you may need to use --with-bdeps=y, as stated in the faq:
Comment 4 Waldemar Szostak 2011-02-16 01:04:14 UTC
emerge --info sys-apps/portage
Portage (default/linux/amd64/10.0, gcc-4.4.5, glibc-2.13-r0, 2.6.37-gentoo x86_64)
                        System Settings
System uname: Linux-2.6.37-gentoo-x86_64-AMD_Phenom-tm-_II_X6_1055T_Processor-with-gentoo-2.0.1
Timestamp of tree: Mon, 14 Feb 2011 21:15:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 2.7.1, 3.1.3
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.4.5, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers: (sys-kernel/linux-headers)                                                         
ACCEPT_KEYWORDS="amd64 ~amd64"                                                                                   
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 skype-eula dlj-1.1 PUEL"                                                
CFLAGS="-march=amdfam10 -funroll-loops -O2 -pipe"                                                                
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
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.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /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="-march=amdfam10 -funroll-loops -O2 -pipe"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion bzip2 cairo cdda cddax cddb cdio cdparanoia cdr chm cli consolekit cracklib crypt cups curl custom-cflags custom-cpuopts custom-optimization cxx dbus dirac directfb djavu dts dvd dvdr ebook enca encode exif fbcon fbcondecor ffmpeg firefox firefox3 flac fortran gadu gdbm gnutls gpm hal hddtemp iconv id3tag ieee1394 jabber jack java java6 javascript jingle jpeg kate kde laptop latex lcdfilter libass libnotify libtiger lm_sensors lzma matroska minimal mmx mmxext mng modules mp3 mp4 mpeg mtp mudflap multilib musepack mysql ncurses nls nptl nptlonly nsplugin ntp nvidia ogg opengl openmp pam pcre pdf perl plasma png policykit pppd pvr python qt-static qt3 qt3support qt4 rar rdp readline rtsp schroedinger session skype smp spell sse sse2 ssl ssse3 startup-notification svg sysfs syslog tcpd theora threads thumbnail tiff truetype twolame udev unicode upnp usb vaapi vcd vcdinfo vcdx vim-syntax vnc vorbis win64 wmf xcb xcomposite xine xinerama xorg xosd xulrunner xv xvid xvmc zip 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" 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" 

                        Package Settings

sys-apps/portage- was built with the following:
USE="(ipc) (multilib) -build -doc -epydoc -python2 -python3 (-selinux)" LINGUAS="pl"
Comment 5 Waldemar Szostak 2011-02-16 01:05:32 UTC
> Generally, this means that the older versions would be removed by emerge
> --depclean. Please check the output of emerge --pretend --depclean.

'emerge --pretend --depclean' did not report any version of python to be removed.
Comment 6 Zac Medico gentoo-dev 2011-02-16 01:10:16 UTC
Please attach the output of this command:

  emerge -pvNDu world --with-bdeps=y --backtrack=0 --debug &> debug.log
Comment 7 Waldemar Szostak 2011-02-16 16:20:40 UTC
Created attachment 262755 [details]
emerge -pvNDu world --with-bdeps=y --backtrack=0 --debug &> debug.log
Comment 8 Zac Medico gentoo-dev 2011-02-16 16:26:04 UTC
Also, please post this output for comparision:

  emerge -pv --depclean --debug &> depclean.log
Comment 9 Zac Medico gentoo-dev 2011-02-16 16:32:32 UTC
Actually, depclean output isn't necessary, since I see that you have dev-lang/python:2.6 in world. Maybe the python-2.6 rebuild didn't happen because it's masked somehow. Please post the output of the following command:

  emerge -pv dev-lang/python:2.6
Comment 10 Zac Medico gentoo-dev 2011-02-16 16:36:50 UTC
(In reply to comment #9)
> Please post the output of the following command:
>   emerge -pv dev-lang/python:2.6

I'm curious to see if this will really show a change in USE=threads for that package. The debug output seems to indicate that there's no change there.
Comment 11 Waldemar Szostak 2011-02-16 16:40:26 UTC
Not sure if you've noticed, but I eventually reinstalled explicitly the 2.6 version.

# emerge -pv dev-lang/python:2.6

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

Calculating dependencies... done!
[ebuild   R   ] dev-lang/python-2.6.6-r1  USE="gdbm ncurses readline ssl threads (wide-unicode) xml -berkdb -build -doc -examples -ipv6 -sqlite -tk -wininst" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 12 Waldemar Szostak 2011-02-16 16:41:57 UTC
Created attachment 262763 [details]
emerge -pv --depclean --debug &> depclean.log
Comment 13 Zac Medico gentoo-dev 2011-02-16 16:44:35 UTC
(In reply to comment #11)
> Not sure if you've noticed, but I eventually reinstalled explicitly the 2.6
> version.

I guess it got added to the world file when you did that, because the debug output shows the world file is the only thing pulling it into the dependency graph. That means emerge is working as intended. If you remove it from the world file, --depclean should show it as eligible for removal:

  emerge --deselect dev-lang/python:2.6
  emerge -pv --depclean dev-lang/python:2.6
Comment 14 Waldemar Szostak 2011-02-16 17:12:10 UTC
# emerge --deselect dev-lang/python:2.6
>>> Removing dev-lang/python:2.6 from "world" favorites file...

#   emerge -pv --depclean dev-lang/python:2.6

Calculating dependencies... done!
>>> Calculating removal order...

>>> These are the packages that would be unmerged:

    selected: 2.6.6-r1 
   protected: none 
     omitted: 2.7.1 3.1.3 

All selected packages: dev-lang/python-2.6.6-r1

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Packages installed:   1014
Packages in world:    193
Packages in system:   50
Required packages:    1013
Number to remove:     1
Comment 15 Zac Medico gentoo-dev 2011-02-16 17:17:14 UTC
Essentially, the problem is that you need to run emerge --depclean after every update, in order to remove unnecessary packages (or let you know which ones you should add to your world file if you want to keep them).
Comment 16 Zac Medico gentoo-dev 2011-02-18 15:29:52 UTC
It's quite common for people to be confused about this stuff, so I think we should incorporate the information from the faq into the emerge man page.
Comment 17 Waldemar Szostak 2011-02-18 16:41:39 UTC
IMO from the perspective of a regular user, I think that this bug boils to an improper (IMHO) handling of emerge's -N paramater.

Namely, having a few versions of python, I changed the USE flags, yet only the flags of the latest version were checked against the USE flags changes. I had to query emerge for information about each version of the package in order to be able to see if any of them needs to be re-installed.
Comment 18 Zac Medico gentoo-dev 2011-02-18 17:03:40 UTC
(In reply to comment #17)
> IMO from the perspective of a regular user, I think that this bug boils to an
> improper (IMHO) handling of emerge's -N paramater.

I see why you'd say that, but -N is a package selection parameter that can only have an affect for packages the are reachable from the package(s) given as arguments. The reason that dev-lang/python:2.6 wasn't pulled in was that it was not reachable (and was thus eligible for removal by --depclean).

Generally, it's desired to leave such unreachable packages out of the dependency graph, since they are typically removed by --depclean and so there's no benefit from updating or rebuilding them. Also, such packages are left out of the dependency graph since sometimes it is necessary to uninstall them, in order to solve blockers.
Comment 19 Zac Medico gentoo-dev 2011-02-22 02:10:52 UTC
I haven't updated the man page yet, but I've made emerge suggest to run --depclean after world updates:;a=commit;h=550795df709cfa9ec4a9502a4ad835319f778e95
Comment 20 Zac Medico gentoo-dev 2011-02-22 02:43:55 UTC
The message looks like this:

 * After world updates, it is important to remove obsolete packages with
 * emerge --depclean. Refer to `man emerge` for more information.
Comment 21 Zac Medico gentoo-dev 2011-02-22 19:51:12 UTC
The warning message is included in and 2.2.0_alpha25, but I'll leave this bug open until the man page is also updated.
Comment 22 Waldemar Szostak 2011-02-24 16:57:52 UTC
I guess it's a good solution and compromise. Thanks!