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.

This will affect those who do not yet have e.g. Python 3.10 installed or are upgrading an older installation with no recent Pythons installed.

Error mentions one version not yet installed
If the error mentions Python versions not yet installed like Python 3.10 but you have some valid Pythons installed (like 3.9), please try.

Error mentions default version not yet installed (old install)
If the error mentions Python versions that are installed that are the current default (Python 3.9 at time of writing in November 2021):
 * 1) Temporarily mask   in.
 * 2) Temporarily unmask the 'crypt' use flag for   (in, add:  )
 * 3) Temporarily unmask   in.
 * 4) Attempt a world upgrade.
 * 5) Undo Step 1, Step 2, and Step 3.
 * 6) Attempt another world upgrade.

This process is temporarily delaying the libxcrypt migration to get a new version of each Python needed installed before it's queued to be rebuilt against the new libcrypt.

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
 * and when findlib has USE=tk,, Onkobu (talk) 20:18, 17 January 2022 (UTC)