Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 925625 - sys-apps/portage: emerge --autounmask-continue can continue with an invalid dependency calculation when recursive USE changes are required
Summary: sys-apps/portage: emerge --autounmask-continue can continue with an invalid d...
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:
: 927576 (view as bug list)
Depends on:
Blocks: autounmask
  Show dependency tree
 
Reported: 2024-02-27 15:23 UTC by matoro
Modified: 2024-04-16 17:19 UTC (History)
5 users (show)

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


Attachments
build.log and emerge --info (file_925625.txt,10.41 KB, text/plain)
2024-02-27 15:24 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-02-27 15:23:36 UTC
Missing dep?  Possibly due to enabling --getbinpkg.

../libdrm-2.4.120/meson.build:85:16: ERROR: Dependency "pciaccess" not found, tried pkgconfig and cmake

Reproducible: Always
Comment 1 matoro archtester 2024-02-27 15:24:53 UTC
Created attachment 886129 [details]
build.log and emerge --info
Comment 2 Ionen Wolkens gentoo-dev 2024-02-27 16:52:42 UTC
(In reply to matoro from comment #0)
> Missing dep?  Possibly due to enabling --getbinpkg.
That'd sound odd, it's in both DEPEND and RDEPEND when video_cards_intel is enabled (and it is here), and it does have MULTILIB_USEDEP.

COMMON_DEPEND="
    video_cards_intel? ( >=x11-libs/libpciaccess-0.13.1-r1:=[${MULTILIB_USEDEP}] 
)"
DEPEND="${COMMON_DEPEND}
    valgrind? ( dev-debug/valgrind )"
RDEPEND="${COMMON_DEPEND}

And I see it for both in the metadata as well, so there's no typos or otherwise.

Looking at libpciaccess it seems to install properly for abi_x86_32 too. So I can't reproduce, not that I messed with this much.

Is libpciaccess entirely uninstalled for you or is /usr/lib/pkgconfig/pciaccess.pc missing despite being installed?
Comment 3 Ionen Wolkens gentoo-dev 2024-02-27 16:55:23 UTC
And is USE=abi_x86_32 set on it?

(maybe it's some nonsense with binpkgs having not respected it, it wouldn't be an issue with this package anyhow)
Comment 4 matoro archtester 2024-02-27 18:11:44 UTC
I looked into it some more and there seems to be some weird portage dep solving going on.

My test runs:  emerge --autounmask --autounmask-continue --getbinpkg =app-emulation/wine-vanilla-9.0

This tries to build libdrm multilib, but libpciaccess without.

[binary  N     ] x11-libs/libpciaccess-0.17-r1-13::gentoo  USE="zlib" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild  N     ] x11-libs/libdrm-2.4.120::gentoo  USE="-test -tools -udev -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu intel nouveau radeon (-exynos) (-freedreno) (-omap) (-tegra) (-vc4) (-vivante) -vmware" 0 KiB


Breaking it down into two steps...if I run:

emerge --autounmask --autounmask-continue --autounmask-only, then it writes to disk x11-libs/libdrm abi_x86_32

but then if I run that SAME command again, it now detects that libpciaccess needs abi_x86_32, and emerges properly.

I tried adding --autounmask-backtrack=y, but it did not help at either step.

I also tried disabling binpkgs, but it did not help, in fact only made it worse, the same issue now pops up with virtual/libelf.
Comment 5 matoro archtester 2024-02-27 18:37:57 UTC
I'll close this as it's possibly a portage issue.  For now as a workaround I will add an extra step that runs --autounmask-only prior to merging.
Comment 6 Zac Medico gentoo-dev 2024-02-27 20:58:19 UTC
(In reply to matoro from comment #4)
> I looked into it some more and there seems to be some weird portage dep
> solving going on.
> 
> My test runs:  emerge --autounmask --autounmask-continue --getbinpkg
> =app-emulation/wine-vanilla-9.0
> 
> This tries to build libdrm multilib, but libpciaccess without.
> 
> [binary  N     ] x11-libs/libpciaccess-0.17-r1-13::gentoo  USE="zlib"
> ABI_X86="(64) -32 (-x32)" 0 KiB
> [ebuild  N     ] x11-libs/libdrm-2.4.120::gentoo  USE="-test -tools -udev
> -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu intel nouveau radeon
> (-exynos) (-freedreno) (-omap) (-tegra) (-vc4) (-vivante) -vmware" 0 KiB
> 
> 
> Breaking it down into two steps...if I run:
> 
> emerge --autounmask --autounmask-continue --autounmask-only, then it writes
> to disk x11-libs/libdrm abi_x86_32
> 
> but then if I run that SAME command again, it now detects that libpciaccess
> needs abi_x86_32, and emerges properly.

It sounds like a --autounmask-continue flaw where an automated USE change in one package should have also triggered an automated USE change in a dependency package in order to satisfy a dependency of the first USE change.
Comment 7 matoro archtester 2024-02-27 20:59:23 UTC
(In reply to Zac Medico from comment #6)
> (In reply to matoro from comment #4)
> > I looked into it some more and there seems to be some weird portage dep
> > solving going on.
> > 
> > My test runs:  emerge --autounmask --autounmask-continue --getbinpkg
> > =app-emulation/wine-vanilla-9.0
> > 
> > This tries to build libdrm multilib, but libpciaccess without.
> > 
> > [binary  N     ] x11-libs/libpciaccess-0.17-r1-13::gentoo  USE="zlib"
> > ABI_X86="(64) -32 (-x32)" 0 KiB
> > [ebuild  N     ] x11-libs/libdrm-2.4.120::gentoo  USE="-test -tools -udev
> > -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu intel nouveau radeon
> > (-exynos) (-freedreno) (-omap) (-tegra) (-vc4) (-vivante) -vmware" 0 KiB
> > 
> > 
> > Breaking it down into two steps...if I run:
> > 
> > emerge --autounmask --autounmask-continue --autounmask-only, then it writes
> > to disk x11-libs/libdrm abi_x86_32
> > 
> > but then if I run that SAME command again, it now detects that libpciaccess
> > needs abi_x86_32, and emerges properly.
> 
> It sounds like a --autounmask-continue flaw where an automated USE change in
> one package should have also triggered an automated USE change in a
> dependency package in order to satisfy a dependency of the first USE change.

Yes, that seems to describe what's going on here.  Is that not a supported use case for --autounmask-continue?
Comment 8 Zac Medico gentoo-dev 2024-02-27 21:09:28 UTC
I think it's a flaw we should fix. The --autounmask-continue option is not intended to continue with an invalid calculation like this, and also plain --autounmask could benefit from the ability to create USE changes recursively when needed.
Comment 9 Zac Medico gentoo-dev 2024-03-02 22:39:35 UTC
I created the test case in https://github.com/gentoo/portage/pull/1298 to try and reproduce the issue, but was not able to. It correctly generated all of these USE changes without any backtracking:

> The following USE changes are necessary to proceed:
>  (see "package.use" in the portage(5) man page for more details)
> # required by app-emulation/wine-vanilla-9.0::test_repo
> # required by @selected
> # required by @world (argument)
> >=media-libs/gst-plugins-base-1.20.6 abi_x86_32
> # required by media-libs/gst-plugins-base-1.20.6::test_repo
> # required by app-emulation/wine-vanilla-9.0::test_repo
> # required by @selected
> # required by @world (argument)
> >=x11-libs/libdrm-2.4.120 abi_x86_32
> # required by x11-libs/libdrm-2.4.120::test_repo
> # required by media-libs/gst-plugins-base-1.20.6::test_repo
> # required by app-emulation/wine-vanilla-9.0::test_repo
> # required by @selected
> # required by @world (argument)
> >=x11-libs/libpciaccess-0.17-r1 abi_x86_32
> # required by x11-libs/libpciaccess-0.17-r1::test_repo[zlib]
> # required by x11-libs/libdrm-2.4.120::test_repo
> # required by media-libs/gst-plugins-base-1.20.6::test_repo
> # required by app-emulation/wine-vanilla-9.0::test_repo
> # required by @selected
> # required by @world (argument)
> >=sys-libs/zlib-1.3-r4 abi_x86_32
Comment 10 Matt Turner gentoo-dev 2024-04-16 17:19:40 UTC
*** Bug 927576 has been marked as a duplicate of this bug. ***