User:Sam/Portage help/Circular dependencies

A circular dependency is where a cycle of packages depend on each other, e.g..

Background
On desktop profiles,  is enabled which is needed for font rendering. But plenty of packages will require  to be enabled on  for rendering.

This causes a circular dependency between and. It appears there's discussion ongoing upstream as to how to resolve the issue (perhaps by embedding code from one into the other).

The cycle looks like this:
 * 1)   depends on
 * 2)   depends on

Given so many packages need, it must be turned on in almost all situations - but it's frustrating as it's not immediately obvious from the two ebuilds themselves.

Solution
The simplest solution which works for now is taking advantage of the fact that an older version of does not need :

If that fails, in almost all cases, the following should suffice,

If not, read on.

Sledgehammer
The following works although is a little bit convoluted:

Or for multilib, something like:

Background
See the libcrypt migration article. Occurs when upgrading from stable to ~arch. Temporary until migrated stages ship (once the libxcrypt migration hits stable).

Error mentions versions not installed
If the error mentions Python versions not yet installed like Python 3.10, please try.

Error mentions versions installed
If the error mentions Python versions that are installed (maybe Python 3.9):
 * 1) Temporarily mask ">=sys-libs/glibc-2.33-r7" and "virtual/libcrypt:0/2" /etc/portage/package.mask
 * 2) Temporarily unmask "virtual/libcrypt:0/1" in /etc/portage/package.unmask
 * 3) Attempt a world upgrade.

Background
Gentoo's desktop profiles enable  which is handy for plenty of users. While it's useful for most packages, it's debatable whether or not it should apply to as it seems not much uses its bluetooth support.

See for more discussion.

The cycle looks like this:
 * 1)   depends on
 * 2)   unconditionally needs   to build!

Solution
In some cases, as a result of this observation, it's sufficient to run (adjust :3.9 to whichever new slot of Python is being pulled in):

Where this isn't enough, it's easiest to temporarily disable bluetooth support in :

Then complete a world update, then delete the entry from the file.

TODO
[07:32:55] <@juippis> sam_: are you collecting known circular dep cases? [07:33:00] <@juippis> sam_: there was one with mit-krb5 [07:35:33] <@juippis> I _think_ mit-krb5[openldap] -> openldap[kerberos] -> mit-krb5. Also there was one with qemu where it depends on itself

mono and libgdiplus