When emerge drops circular dependencies, it's possible to limit the scope in order to minimize negative effects. For example, the approach that's currently used to handle runtime cycles can be extended to handle buildtime cycles in cases where the buildtime dependencies happen to be satisfied by installed packages. It can be extended further to verify that the installed packages are in a valid state (bug 199856).
I have an experimental patch that extends the runtime cycle handling to handle buildtime cycles: https://github.com/zmedico/portage/commits/bug_690436_limit_scope_of_dropped_circular_dependencies
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=7dc4131eca73aee2a78fd5c4339cb41760f7a54f commit 7dc4131eca73aee2a78fd5c4339cb41760f7a54f Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-12-25 07:55:24 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-12-25 08:09:22 +0000 MergeOrderTestCase: update circ-buildtime mergelist for bug 690436 Update mergelist for the circ-buildtime test case so that it will pass after the fix for bug 690436, and also add a commented merge order assertion which will succeed after the fix. Bug: https://bugs.gentoo.org/690436 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/tests/resolver/test_merge_order.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/91d3fefa33322c4d7c906a6d1c5cd0d9 https://github.com/gentoo/portage/pull/491
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=680276cc4d4faa653203366cbe3c896ac3883cf2 commit 680276cc4d4faa653203366cbe3c896ac3883cf2 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-12-25 08:37:18 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-12-26 22:56:39 +0000 _serialize_tasks: limit scope of dropped circular dependencies Ensure that all members of a buildtime dependency cycle are merged as a group, such that packages which depend on one or more members of the group will only be merged *after* the entire group has been merged. This extends runtime cycle handling to also handle buildtime cycles in cases where the buildtime dependencies happen to be satisfied by installed packages. In situations when this is necessary, it is desirable to rely on the old installed instances of these packages as little as possible, since they might have been broken by the upgrade of a package that is a member of the dependency cycle. Upgrading members of the cycle as a group effectively minimizes reliance on the old installed package instances, avoiding some cases of bug 199856. For example, it should avoid bug 703676, where libspectre reportedly failed to build against an old installed instance of ghostscript-gpl. Bug: https://bugs.gentoo.org/199856 Bug: https://bugs.gentoo.org/689644 Bug: https://bugs.gentoo.org/690436 Bug: https://bugs.gentoo.org/703676 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/depgraph.py | 94 +++++++++++++++----------- lib/portage/tests/resolver/test_merge_order.py | 25 ++++++- 2 files changed, 78 insertions(+), 41 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1793a98a4543c8ea3b166af4383744ab060f37d5 commit 1793a98a4543c8ea3b166af4383744ab060f37d5 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-12-26 22:46:29 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-12-26 22:49:36 +0000 sys-apps/portage: Bump to version 2.3.84 #690436 limit scope of dropped circular dependencies, which should solve some cases of bug 199856 such as bug 703676 (also see tracker bug 689644) Bug: https://bugs.gentoo.org/701268 Bug: https://bugs.gentoo.org/199856 Bug: https://bugs.gentoo.org/689644 Bug: https://bugs.gentoo.org/690436 Bug: https://bugs.gentoo.org/703676 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-2.3.84.ebuild | 276 +++++++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e commit 9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2023-11-18 17:07:59 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2023-11-19 04:15:22 +0000 find_smallest_cycle: Increase ignore_priority to find smaller cycles Fix AlternativesGzipTestCase by increasing ignore_priority in order to find smaller cycles. This causes some changes in merge order for MergeOrderTestCase, but they appear to be acceptable since they prevent temporarily unsatisfied RDEPEND by relying on satisfied installed build-time dependencies. Add a test case for bug 690436, since the change to merge order in MergeOrderTestCase is related (see commit 680276cc4d4f). Bug: https://bugs.gentoo.org/690436 Bug: https://bugs.gentoo.org/917259 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/depgraph.py | 7 +- lib/portage/tests/resolver/meson.build | 1 + .../tests/resolver/test_alternatives_gzip.py | 7 +- lib/portage/tests/resolver/test_merge_order.py | 24 ++-- .../tests/resolver/test_rebuild_ghostscript.py | 160 +++++++++++++++++++++ 5 files changed, 180 insertions(+), 19 deletions(-)