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

Bug 166564

Summary: Portage: Circular dependencies output is difficult to decipher
Product: Portage Development Reporter: Radu Stefan <radu124>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: major CC: dblmok115
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 167107    
Attachments: reduce the noise level in the circular dependency debug output

Description Radu Stefan 2007-02-12 20:36:08 UTC
Trying to emerge either gnome or kde results in an "circular dependencies" error
Comment 1 Zac Medico gentoo-dev 2007-02-12 20:46:47 UTC
Created attachment 109992 [details, diff]
reduce the noise level in the circular dependency debug output

This patch will filter the noise so that it's easier to see the cycles.  If it's saved as /tmp/circular_deps.patch, then it can be applied as follows:

patch /usr/lib/portage/bin/emerge < /tmp/circular_deps.patch

Generally, you can break dependency cycles by disabling use flags.  For example, to break a circular dependency between media-libs/libsdl-1.2.11 and dev-libs/DirectFB-0.9.25.1, you can temporarily disable the either of the directfb or sdl USE flags for one of those packages via package.use.  After both of them have been built, change the USE flags back to the original setting and rebuild the package that had a flag temporarily disabled.
Comment 2 Radu Stefan 2007-02-13 09:57:05 UTC
(In reply to comment #1)
> reduce the noise level in the circular dependency debug output
I have solved the problem in the mean time, but I appreciate your feedback. 

Indeed, the amount of output gave me a hard time finding the cycle. It was a strange combination of alsa/jdk/doxygen. I'm still a beginner with gentoo, so it will take a while to get used to these things.

There must be a better way to solve this though, maybe automatically discover conditional dependencies and performing the steps you just mentioned automatically. From the algorithmic point of view it should not be difficult, at least for the common case that you described, but I have no idea what it would take to implement it.
Comment 3 Zac Medico gentoo-dev 2007-02-13 18:23:05 UTC
(In reply to comment #2)
> There must be a better way to solve this though, maybe automatically discover
> conditional dependencies and performing the steps you just mentioned
> automatically. From the algorithmic point of view it should not be difficult,
> at least for the common case that you described, but I have no idea what it
> would take to implement it.

I'm planning to rewrite the dependency resolver soon and that feature is certainly planned.
Comment 4 Zac Medico gentoo-dev 2007-02-19 21:48:02 UTC
In addition to the reduced noise debug output, the nodes that are part of cycles are also displayed like a merge list with --tree mode enabled (including the USE flag settings).

This has been released in 2.1.2-r10.
Comment 5 Zac Medico gentoo-dev 2007-02-28 18:06:45 UTC
*** Bug 168697 has been marked as a duplicate of this bug. ***