Bug 166564 - Portage: Circular dependencies output is difficult to decipher
Bug#: 166564 Product:  Portage Development Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: major Priority: P2
Resolution: FIXED Assigned To: dev-portage@gentoo.org Reported By: radu124@gmail.com
Component: Core - Dependencies
URL: 
Summary: Portage: Circular dependencies output is difficult to decipher
Keywords:  
Status Whiteboard: 
Opened: 2007-02-12 20:36 0000
Description:   Opened: 2007-02-12 20:36 0000
Trying to emerge either gnome or kde results in an "circular dependencies"
error

------- Comment #1 From Zac Medico 2007-02-12 20:46:47 0000 -------
Created an attachment (id=109992) [details]
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 From Radu Stefan 2007-02-13 09:57:05 0000 -------
(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 From Zac Medico 2007-02-13 18:23:05 0000 -------
(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 From Zac Medico 2007-02-19 21:48:02 0000 -------
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 From Zac Medico 2007-02-28 18:06:45 0000 -------
*** Bug 168697 has been marked as a duplicate of this bug. ***