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

Bug 417675

Summary: Fixing the recursive dependency hell with FEATURES=test
Product: Portage Development Reporter: Jeroen Roovers (RETIRED) <jer>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: as.gentoo, hwoarang, kensington, sam, zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=703348
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 175808    
Bug Blocks: 912975    

Description Jeroen Roovers (RETIRED) gentoo-dev 2012-05-26 17:51:51 UTC
Since a lot of packages set src_test() dependencies through USE=test, having USE=test enabled by default often leads to circular dependencies that emerge cannot resolve.

Since we're supporting this magical linkage between FEATURES=test and USE=test, we might as well take it a step further and disable src_test() automatically when USE=test dependencies cannot be met because of circular dependencies.

 ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
elmer ~ # emerge -vuaDNt world

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

Calculating dependencies... done!


[nomerge       ] app-i18n/uim-1.7.3  USE="X anthy canna curl eb emacs gtk gtk3 libedit libffi m17n-lib ncurses nls prime qt4 skk sqlite ssl test unicode xft (-gnome) (-kde) (-libnotify) -static-libs" LINGUAS="-ja -ko -zh_CN -zh_TW"
[nomerge       ]  app-i18n/prime-1.0.0.1
[nomerge       ]   dev-ruby/ruby-progressbar-0.0.9  USE="test" RUBY_TARGETS="ruby18"
[nomerge       ]    virtual/rubygems-1  RUBY_TARGETS="(ruby18)"
[nomerge       ]     dev-ruby/rubygems-1.8.24 [1.8.15] USE="server test" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)"
[nomerge       ]      dev-ruby/minitest-2.8.1 [2.6.2] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)"
[nomerge       ]       dev-ruby/hoe-2.12.5 [2.8.0] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)"
[ebuild     U ~]        dev-ruby/rubyforge-2.0.4-r2 [2.0.4-r1] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 0 kB
[ebuild     U ~]         dev-ruby/hoe-2.12.5 [2.8.0] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 120 kB
[ebuild     U ~]     dev-ruby/rubygems-1.8.24 [1.8.15] USE="server test" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 372 kB
[ebuild     U ~]      dev-ruby/minitest-2.8.1 [2.6.2] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 0 kB
[ebuild  NS   ~]      virtual/ruby-rdoc-1 [0] RUBY_TARGETS="(ruby19)" 0 kB
[ebuild     U ~]       dev-ruby/rdoc-3.12 [3.5.1] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 0 kB
[ebuild  N    ~]        dev-ruby/racc-1.4.6-r1  USE="test" RUBY_TARGETS="ruby18 ruby19 (-jruby) (-ree18)" 0 kB
[ebuild     U ~]        dev-ruby/json-1.5.4-r1 [1.5.4] USE="test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 0 kB
[ebuild     U ~]         dev-ruby/rake-0.8.7-r6 [0.8.7-r5] USE="bash-completion test -doc" RUBY_TARGETS="ruby18 ruby19%* (-jruby) (-ree18)" 0 kB
[ebuild  NS   ~]          virtual/rubygems-4 [1] RUBY_TARGETS="(ruby19)" 0 kB

Total: 10 packages (7 upgrades, 1 new, 2 in new slots), Size of downloads: 492 kB

 * Error: circular dependencies:

(dev-ruby/hoe-2.12.5::gentoo, ebuild scheduled for merge) depends on
 (dev-ruby/rdoc-3.12::gentoo, ebuild scheduled for merge) (buildtime)
  (dev-ruby/hoe-2.12.5::gentoo, ebuild scheduled for merge) (buildtime)

It might be possible to break this cycle
by applying any of the following changes:
- dev-ruby/rdoc-3.12 (Change USE: -test)
- dev-ruby/hoe-2.12.5 (Change USE: -test)

Note that this change can be reverted, once the package has been installed.

Note that the dependency graph contains a lot of cycles.
Several changes might be required to resolve all cycles.
Temporarily changing some use flag for all packages might be the better option.
 ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~

In the case above, setting FEATUTES=-test USE=-test means rebuilding a lot of the installed packages. Instead, since USE=test is special already (it should only affect what happens in src_test(), right?) we might as well disable the test phase, tell the user in einfo, and be done with it. We could even write that to vdb so that on the next run, the package is re-emerged but with src_test() getting run properly this time.
Comment 1 Zac Medico gentoo-dev 2012-05-26 20:59:45 UTC
(In reply to comment #0)
> In the case above, setting FEATUTES=-test USE=-test means rebuilding a lot
> of the installed packages.

In bug 373209 comment #3 we have a plan to make --newuse independent of USE=test state.
Comment 2 Zac Medico gentoo-dev 2012-05-26 21:11:07 UTC
*** Bug 296818 has been marked as a duplicate of this bug. ***
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-05-02 06:42:51 UTC
This issue got a little bit of discussion on the ML lately and imho is a rather big issue which is preventing some devs (me at least) from running useful tests widely across the tree.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-02-06 23:40:06 UTC
--with-test-deps is neat and pretty close for this, but doesn't automatically solve if you go straight for FEATURES="test".