Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 872227 - sys-apps/portage-3.0.36 fails to choose alternative dependency and prefers to keep old/no longer existing version installed
Summary: sys-apps/portage-3.0.36 fails to choose alternative dependency and prefers to...
Status: CONFIRMED
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:
: 877159 (view as bug list)
Depends on:
Blocks: 155723
  Show dependency tree
 
Reported: 2022-09-21 16:32 UTC by Pacho Ramos
Modified: 2023-06-24 17:44 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2022-09-21 16:32:50 UTC
I was wondering why I was still having old sys-apps/xdg-desktop-portal-gtk-1.8.0 and even emerge -avuDN world wasn't even mentioning a package couldn't be updated:
# emerge -pvuDN world

These are the packages that would be merged, in order:

Calculating dependencies... done!

Total: 0 packages, Size of downloads: 0 KiB

If I try to manually update it, it fails with:
# emerge -1av xdg-desktop-portal-gtk --backtrack=100

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-apps/xdg-desktop-portal-gtk-1.14.0::gentoo [1.8.0::gentoo] USE="X wayland" 373 KiB

Total: 1 package (1 upgrade), Size of downloads: 373 KiB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

sys-apps/xdg-desktop-portal-gtk:0

  (sys-apps/xdg-desktop-portal-gtk-1.14.0:0/0::gentoo, ebuild scheduled for merge) USE="X wayland" ABI_X86="(64)" pulled in by
    sys-apps/xdg-desktop-portal-gtk (Argument)

  (sys-apps/xdg-desktop-portal-gtk-1.8.0:0/0::gentoo, installed) USE="X wayland" ABI_X86="(64)" pulled in by
    <sys-apps/xdg-desktop-portal-gtk-1.14.0 required by (gnome-base/gnome-shell-42.4-r1:0/0::gentoo, installed) USE="bluetooth browser-extension ibus networkmanager systemd (-elogind) -gtk-doc -telepathy -test" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_10 (-python3_11) -python3_8 -python3_9"
    ^                                ^^^^^^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             


It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is also
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously.  If such a conflict exists in
the dependencies of two different packages, then those packages can
not be installed simultaneously.

For more information, see MASKED PACKAGES section in the emerge man
page or refer to the Gentoo Handbook.

But, to solve the dep, it simply needs to choose the other option listed in gnome-base/gnome-shell-42.4-r1 ebuild:
|| ( sys-apps/xdg-desktop-portal-gnome <sys-apps/xdg-desktop-portal-gtk-1.14.0 )

Indeed, if I try to merge both, it works:
# emerge -1av xdg-desktop-portal-gtk xdg-desktop-portal-gnome

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-apps/xdg-desktop-portal-gtk-1.14.0::gentoo [1.8.0::gentoo] USE="X wayland" 373 KiB
[ebuild  N     ] sys-apps/xdg-desktop-portal-gnome-42.3::gentoo  USE="X wayland" 117 KiB

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 489 KiB

It looks like bug 161953, but I am surprised to keep the behavior of preferring installed package even if that ends up using a no longer existing ebuild that, at some point, will break for sure :/

I know I can workaround revbumping and changing the dep in gnome-shell to force the new package unconditionally... but I still find dangerous to default on keeping old/non-existing versions forever when it is possible to install the alternative offered by || ( ) dependency statement 

Thanks
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-22 02:27:52 UTC
1. For the world upgrade: if it's satisfied by an existing dep, it has no reason to swap.

2. For the individual emerge, yeah, it's held back, it's the same as https://wiki.gentoo.org/wiki/Project:Portage/FAQ#Why_is_there_a_dependency_conflict_when_I_attempt_to_upgrade_a_single_package.3F.

If/when <sys-apps/xdg-desktop-portal-gtk-1.14.0 is masked, it'll upgrade. But it doesn't see a reason to flip flop for now.
Comment 2 Pacho Ramos gentoo-dev 2022-09-22 08:11:12 UTC
The reason to flip-flop would be that the ebuild that satisfies the dep is no longer existing in the tree and, then, it will likely break in the future, either their old dependency tree or the package itself will stop working as the rest of the system keeps updating in the upcoming years (like happens in bug 760783 and others in its "See Also")
Comment 3 cyrillic 2022-09-23 23:27:02 UTC
It looks like portage is doing the right thing, because the only version of xdg-desktop-portal-gtk available in the tree is not less than 1.14.0

# equery list -ipo sys-apps/xdg-desktop-portal-gtk
 * Searching for xdg-desktop-portal-gtk in sys-apps ...
[IP-] [  ] sys-apps/xdg-desktop-portal-gtk-1.14.0:0

# equery list -ipo sys-apps/xdg-desktop-portal-gnome
 * Searching for xdg-desktop-portal-gnome in sys-apps ...
[IP-] [  ] sys-apps/xdg-desktop-portal-gnome-42.3:0
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-24 00:34:57 UTC
(In reply to Pacho Ramos from comment #2)
> The reason to flip-flop would be that the ebuild that satisfies the dep is
> no longer existing in the tree and, then, it will likely break in the
> future, either their old dependency tree or the package itself will stop
> working as the rest of the system keeps updating in the upcoming years (like
> happens in bug 760783 and others in its "See Also")

Ah, thanks, I'd missed that there's no older versions in tree, oops. I'm wondering if it ever actually had this behaviour in the past or not, but I agree it seems desirable.

(In reply to cyrillic from comment #3)
> It looks like portage is doing the right thing, because the only version of
> xdg-desktop-portal-gtk available in the tree is not less than 1.14.0
> 
> # equery list -ipo sys-apps/xdg-desktop-portal-gtk
>  * Searching for xdg-desktop-portal-gtk in sys-apps ...
> [IP-] [  ] sys-apps/xdg-desktop-portal-gtk-1.14.0:0
> 

1.14.0 isn't less thsn 1.14.0.

# ls /var/db/repos/gentoo/sys-apps/xdg-desktop-portal-gtk
Manifest  metadata.xml  xdg-desktop-portal-gtk-1.14.0.ebuild

We only have 1.14.0 in tree.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-14 20:30:25 UTC
*** Bug 877159 has been marked as a duplicate of this bug. ***
Comment 6 Larry the Git Cow gentoo-dev 2022-10-14 20:31:14 UTC
The bug has been referenced in the following commit(s):

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

commit f51df08c656a51a72831252a0233370f145b9891
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-14 20:30:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-14 20:31:08 +0000

    gnome-base/gnome-shell: drop xdg-desktop-portal-gtk dep to workaround Portage bug
    
    Bug: https://bugs.gentoo.org/877159
    Bug: https://bugs.gentoo.org/872227
    Signed-off-by: Sam James <sam@gentoo.org>

 .../{gnome-shell-42.4-r3.ebuild => gnome-shell-42.4-r4.ebuild}        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2023-06-24 17:44:17 UTC
The bug has been referenced in the following commit(s):

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

commit b79fe624316f1410e0ac77c10ded47222fcd9d57
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2023-06-24 17:17:02 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2023-06-24 17:17:02 +0000

    sci-chemistry/pymol: Drop dev-libs/msgpack[cxx(-)] to workaround portage bug
    
    Bug: https://bugs.gentoo.org/872227
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

 sci-chemistry/pymol/pymol-2.5.0-r3.ebuild | 98 +++++++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)