Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 346351 - --depclean is not able to clean away circular dependencies between packages
Summary: --depclean is not able to clean away circular dependencies between packages
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-21 18:17 UTC by Petteri Räty (RETIRED)
Modified: 2012-05-06 04:02 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2010-11-21 18:17:02 UTC
pena hobo # emerge -av --depclean "jruby"

Calculating dependencies... done!
  dev-java/jruby-1.5.3 pulled in by:
    dev-ruby/jruby-openssl-0.7
    dev-ruby/rubygems-1.3.7-r4
    virtual/rubygems-0-r4

>>> No packages selected for removal by depclean
Packages installed:   1005
Packages in world:    170
Packages in system:   50
Required packages:    1005
Number removed:       0
pena hobo # emerge -av --depclean "jruby-openssl"

Calculating dependencies... done!
  dev-ruby/jruby-openssl-0.7 pulled in by:
    dev-java/jruby-1.5.3

>>> No packages selected for removal by depclean
Packages installed:   1005
Packages in world:    170
Packages in system:   50
Required packages:    1005
Number removed:       0
pena hobo # emerge -av --depclean "virtual/rubygems"

Calculating dependencies... done!
  virtual/rubygems-0-r4 pulled in by:
    dev-ruby/jruby-openssl-0.7
    dev-ruby/rdoc-2.5.11

>>> No packages selected for removal by depclean
Packages installed:   1005
Packages in world:    170
Packages in system:   50
Required packages:    1005
Number removed:       0
pena hobo # emerge -av --depclean "rdocs"
^C

Exiting on signal 2
^[[Apena hobo # emerge -av --depclean "rdoc"

Calculating dependencies... done!
  dev-ruby/rdoc-2.5.11 pulled in by:
    dev-lang/ruby-1.9.2

>>> No packages selected for removal by depclean
Packages installed:   1005
Packages in world:    170
Packages in system:   50
Required packages:    1005
Number removed:       0
pena hobo # emerge -av --depclean "=ruby-1.9.2"

Calculating dependencies... done!
  dev-lang/ruby-1.9.2 pulled in by:
    dev-ruby/rdoc-2.5.11
    dev-ruby/rubygems-1.3.7-r4
    virtual/rubygems-0-r4

>>> No packages selected for removal by depclean
Packages installed:   1005
Packages in world:    170
Packages in system:   50
Required packages:    1005
Number removed:       0

Portage 2.2.0_alpha4 (default/linux/x86/10.0/desktop, gcc-4.4.5, glibc-2.12.1-r3, 2.6.37-rc1-git10 i686)
=================================================================
System uname: Linux-2.6.37-rc1-git10-i686-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Unknown
ccache version 2.4 [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r2
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4
sys-devel/make:      3.82
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
Repositories: gentoo openrc wschlich-testing finnish dev-jokey sunrise betelgeuse
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 AdobeFlash-10.1 googleearth"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
DISTDIR="/var/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS=" http://trumpetti.atm.tut.fi/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--as-needed -Wl,-O1"
LINGUAS="fi en"
MAKEOPTS="-j8 -s"
PKGDIR="/home/pkg/"
PORTAGE_CONFIGROOT="/"
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="/usr/portage"
PORTDIR_OVERLAY="/mnt/checkouts/overlays/openrc /mnt/checkouts/overlays/wschlich-testing /mnt/checkouts/overlays/finnish /mnt/checkouts/overlays/jokey /mnt/checkouts/overlays/sunrise /mnt/checkouts/overlays/betelgeuse"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="a52 aac acl acpi alsa audiofile bash-completion bluetooth branding bzip2 cairo caps cdb cddb cdparanoia cdr cli consolekit cracklib crypt cups custom-cxxflags cxx dbus dri dts dvd dvdr dvdread emboss exif fam ffmpeg firefox gif glib hal iconv idn ipv6 java jpeg kde kdehiddenvisibility lcms libnotify lm_sensors logitech-mouse mad mikmod mjpeg mmx mng modules mp3 mp4 mpeg mudflap ncurses network nptl nptlonly nsplugin nvidia offensive ogg opengl openmp pam pango pcre pdf png ppds pppd pulseaudio qt3support readline rtc samba semantic-desktop session spell sse sse2 sse3 ssl ssse3 startup-notification subversion svg symlink sysfs system-sqlite theora threads tiff truetype udev unicode usb userlocales vim-syntax vorbis win32codecs x264 x86 xcb xcomposite xinerama xml xorg xulrunner xv xvid xvmc zeroconf zlib" ALSA_CARDS="hda-intel" 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" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fi en" NETBEANS_MODULES="ruby ide webcommon nb harness java websvccommon gsf" PHP_TARGETS="php5-2" QEMU_SOFTMMU_TARGETS="i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="none radeon" 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, FFLAGS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sebastian Luther (few) 2010-11-21 18:35:10 UTC
When --depclean is called with package arguments, only the given packages are considered for removal. This means it worked as expected. Running --depclean without argument or giving all packages in the cycle as arguments at once should work. Maybe this is a dupe of bug 336889?
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2010-11-21 18:56:35 UTC
(In reply to comment #1)
> When --depclean is called with package arguments, only the given packages are
> considered for removal. This means it worked as expected. Running --depclean
> without argument or giving all packages in the cycle as arguments at once
> should work. Maybe this is a dupe of bug 336889?
> 

> 
> >>> No packages selected for removal by depclean
>

Consider changing the output so that it's clear it will not do anything to other packages.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2012-05-06 03:28:02 UTC
With the introduction of virtual/pkgconfig into the tree, dev-libs/glib is no longer pulled into @system if dev-libs/pkgconf[pkg-config] is on the system. However, dev-libs/glib and x11-misc/shared-mime-info depend on one another, so portage is unable to detect that they are no longer needed.

It seems to me that we could resolve this with reachability analysis. We could start with the set of all packages merged on the system, which I will call set A, and a set of all packages explicitly enumerated in @system and @world, which I will call set B. Then removing a package from set B, we can do either a depth first search or a breadth first search on its dependency graph, removing all packages in sets A and B that we encounter from them respectively. We will then repeat, taking the next item from set B. When set B is empty, all packages remaining in set A can be removed.
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-05-06 04:02:04 UTC
(In reply to comment #3)
> With the introduction of virtual/pkgconfig into the tree, dev-libs/glib is
> no longer pulled into @system if dev-libs/pkgconf[pkg-config] is on the
> system. However, dev-libs/glib and x11-misc/shared-mime-info depend on one
> another, so portage is unable to detect that they are no longer needed.

This was user error on my part. One of those two were in @world.