Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919174 - Portage 3.0.56 detects circular dependencies for python/util-linux/selinux
Summary: Portage 3.0.56 detects circular dependencies for python/util-linux/selinux
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 918929
Blocks:
  Show dependency tree
 
Reported: 2023-12-04 18:24 UTC by zen
Modified: 2023-12-10 22:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
archive container emerge -pav output on .56 and .51, emerge --info, Dockerfile (info.tar.xz,8.89 KB, application/x-xz)
2023-12-04 18:24 UTC, zen
Details
Debug level emerge logs (debug.tar.xz,28.30 KB, application/x-xz)
2023-12-04 18:29 UTC, zen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zen 2023-12-04 18:24:50 UTC
Created attachment 876707 [details]
archive container emerge -pav output on .56 and .51, emerge --info, Dockerfile

I am unable to reproduce this in a fresh docker container, but i can reliably reproduce it on my host system.

I get the feeling this is related to the selinux profile. When attempting to reproduce in a container, i did not run -uDN @world before attempting to run the same emerge command.
Comment 1 zen 2023-12-04 18:29:06 UTC
Created attachment 876708 [details]
Debug level emerge logs
Comment 2 genBTC 2023-12-04 21:14:54 UTC
it is being investigated. we think it comes from this:

features/selinux/package.use.force:12:sys-libs/libselinux python

but theres some confusion as to whether that line makes sense or not still
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-05 06:53:08 UTC
Yeah, this might well be unavoidable - at a glance, the deps look legitimate. The only real question for me is whether some of it can be avoided temporarily given they're all binaries...

But tenatively blocking bug 918929 just so we don't forget to look at it.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-05 06:55:59 UTC
(all binaries + ROOT, i should say)
Comment 5 Zac Medico gentoo-dev 2023-12-05 16:39:45 UTC
This is fallout from bug 918683, since we increased the priority of the runtime_slot_op in this cycle, so that it cannot be ignored:

>  * Error: circular dependencies:
> 
> (dev-lang/python-3.11.6-1:3.11/3.11::gentoo, binary scheduled for merge to '/tmp/') depends on
>  (sys-apps/util-linux-2.38.1-r2-1:0/0::gentoo, binary scheduled for merge to '/tmp/') (runtime_slot_op)
>   (sys-libs/libselinux-3.5-r1-1:0/0::gentoo, binary scheduled for merge to '/tmp/') (runtime)
>    (dev-lang/python-3.11.6-1:3.11/3.11::gentoo, binary scheduled for merge to '/tmp/') (runtime)

If these are all actually soname dependencies, then we'll need to temporarily disable a USE flag in order to break this cycle.

If they are not all soname dependencies, then we may be able to adjust portage to temporarily ignore a lower priority dependency. Alternatively, maybe a lower priority dependency can be changed from RDEPEND to PDEPEND.
Comment 6 Zac Medico gentoo-dev 2023-12-05 16:46:33 UTC
Since ROOT != /, temporarily ignoring an soname dependency could be an option as well.
Comment 7 Zac Medico gentoo-dev 2023-12-06 03:38:35 UTC
Not sure if we should open a separate bug for this, but anyway, this is a similar cycle that I found which is in fact an soname dependency in both directions. It was the trigger for bug 919311, and it doesn't happen with portage-3.0.51:

>  * Error: circular dependencies:
>                                                     
> (dev-libs/gmp-6.3.0-2:0/10.4::gentoo, binary scheduled for merge to '/tmp/testroot/') depends on
>  (sys-devel/gcc-13.2.1_p20230826-2:13/13::gentoo, binary scheduled for merge to '/tmp/testroot/') (runtime)
>   (dev-libs/gmp-6.3.0-2:0/10.4::gentoo, binary scheduled for merge to '/tmp/testroot/') (runtime_slot_op)
Comment 8 Zac Medico gentoo-dev 2023-12-06 03:52:30 UTC
(In reply to Zac Medico from comment #7)
The gcc dependency is not specified in the gmp dependencies, so that cycle is only a problem with emerge --ignore-soname-deps=n.
Comment 9 Zac Medico gentoo-dev 2023-12-06 05:02:30 UTC
We can add a DepPriority attribute to indicate when the parent ROOT != / and then use that to add additional DepPriority*Range ignore_priority levels that behave more like the behavior prior to bug 918683.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-06 07:11:43 UTC
(In reply to Zac Medico from comment #9)
> We can add a DepPriority attribute to indicate when the parent ROOT != / and
> then use that to add additional DepPriority*Range ignore_priority levels
> that behave more like the behavior prior to bug 918683.

thanks zac, this is my preference for now, as I really want to avoid weakening it for the general case unless we have to

I'm going to check each of the deps in the original cycle to see if they're all really soname deps too.
Comment 11 Larry the Git Cow gentoo-dev 2023-12-06 20:29:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d856747ada48f8d32c033091b1156cc655efed3

commit 1d856747ada48f8d32c033091b1156cc655efed3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-12-06 06:05:46 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-12-06 20:23:14 +0000

    DepPriority{Normal,Satisfied}Range: weaken _ignore_runtime for cross root
    
    When the dependency parent is for a cross root (ROOT != /) package,
    weaken _ignore_runtime in order to tolerate runtime cycles that are
    less problematic for cross root packages.
    
    The included test case fails with this error without the fix:
    
     * Error: circular dependencies:
    
    (dev-libs/gmp-6.3.0:0/10.4::test_repo, binary scheduled for merge to '/tmp/tmp25nwdjn7/cross_root/') depends on
     (sys-devel/gcc-13.2.1_p20230826:0/0::test_repo, binary scheduled for merge to '/tmp/tmp25nwdjn7/cross_root/') (runtime)
      (dev-libs/gmp-6.3.0:0/10.4::test_repo, binary scheduled for merge to '/tmp/tmp25nwdjn7/cross_root/') (runtime_slot_op)
    
    It might be possible to break this cycle
    by applying the following change:
    - dev-libs/gmp-6.3.0 (Change USE: -cxx)
    
    Bug: https://bugs.gentoo.org/919174
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/DepPriority.py                         |   4 +-
 lib/_emerge/DepPriorityNormalRange.py              |   4 +-
 lib/_emerge/DepPrioritySatisfiedRange.py           |   1 +
 lib/_emerge/UnmergeDepPriority.py                  |   3 +-
 lib/_emerge/depgraph.py                            |  46 ++++--
 lib/portage/tests/resolver/meson.build             |   1 +
 .../tests/resolver/test_cross_dep_priority.py      | 164 +++++++++++++++++++++
 7 files changed, 208 insertions(+), 15 deletions(-)
Comment 12 Larry the Git Cow gentoo-dev 2023-12-10 22:35:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d365d80099d206e49b592abb30030642f8f09f9

commit 0d365d80099d206e49b592abb30030642f8f09f9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-12-10 22:34:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-10 22:34:52 +0000

    sys-apps/portage: add 3.0.57
    
    Closes: https://bugs.gentoo.org/918929
    Closes: https://bugs.gentoo.org/913628
    Closes: https://bugs.gentoo.org/915474
    Closes: https://bugs.gentoo.org/918597
    Closes: https://bugs.gentoo.org/919072
    Closes: https://bugs.gentoo.org/919105
    Closes: https://bugs.gentoo.org/919174
    Closes: https://bugs.gentoo.org/919311
    Closes: https://bugs.gentoo.org/919419
    Closes: https://bugs.gentoo.org/919668
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.57.ebuild | 242 +++++++++++++++++++++++++++++++++
 2 files changed, 243 insertions(+)
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-10 22:50:00 UTC
FWIW, this was also committed a few days ago:

commit a0ff82d513b952a0cd7764ffe8958806499c981d
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Tue Dec 5 11:52:56 2023 +0100

    sys-apps/util-linux: Cut dependency loop in stage1 build

    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>