Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 868513 - sys-apps/portage-3.0.35 ignores RDEPEND "<sys-devel/lld-14" of dev-lang/zig-0.9.1 and happily installs binary package sys-devel/lld-14.0.6
Summary: sys-apps/portage-3.0.35 ignores RDEPEND "<sys-devel/lld-14" of dev-lang/zig-0...
Status: RESOLVED INVALID
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:
Depends on:
Blocks:
 
Reported: 2022-09-04 22:48 UTC by Sebastian Pipping
Modified: 2024-01-12 19:42 UTC (History)
5 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 Sebastian Pipping gentoo-dev 2022-09-04 22:48:36 UTC
dev-lang/zig-0.9.1 has this dependency block in the ebuild:

  DEPEND="
  [..]
          >=sys-devel/lld-${LLVM_MAX_SLOT}
          <sys-devel/lld-$((${LLVM_MAX_SLOT} + 1))
  [..]
  "
  
However lld is a runtime dependency of zig as well, as can be proven:

  # lddtree /usr/bin/zig | grep lld
      liblldELF.so.13 => /usr/lib64/liblldELF.so.13
          liblldCommon.so.13 => /usr/lib64/liblldCommon.so.13
      liblldCOFF.so.13 => /usr/lib64/liblldCOFF.so.13
      liblldWasm.so.13 => /usr/lib64/liblldWasm.so.13

I ran into this because portage happily updates lld to version 14 which puts zig right into @preserved-rebuild because it still links against .so files of version 13.

Would be great to have this fixed.  Thank you!
Comment 1 Ionen Wolkens gentoo-dev 2022-09-05 00:21:08 UTC
But it already is? RDEPEND has all of ${DEPEND} in it

RDEPEND="${DEPEND}
    !dev-lang/zig-bin
"
Comment 2 Sebastian Pipping gentoo-dev 2022-09-05 13:23:15 UTC
My bad, you're right!  File /var/db/pkg/dev-lang/zig-0.9.1/RDEPEND adds another prove on "<sys-devel/lld-14".  Any idea why portage (3.0.30-r5) happily emerges sys-devel/lld-14.0.6 despite dev-lang/zig-0.9.1 installed?

In search for past changes regarding RDEPEND I found https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d005e3b069726d01579b86d32f6fe32c26573aa3 .  A due revbump seems missing here, but the change does not seem to affect lld.  Any ideas?
Comment 3 Sebastian Pipping gentoo-dev 2022-09-05 15:20:15 UTC
It turns out that portage 3.0.30-r3 rejects installation of =sys-devel/lld-14.0.6 due to dev-lang/zig-0.9.1 being installed (good!) while 3.0.30-r5 happily proceeds (bad!).  I'm re-assinging to dev-portage@gentoo.org for now.  EMERGE_DEFAULT_OPTS is "--keep-going --ask --verbose --complete-graph -j 3 --dynamic-deps y --verbose-conflicts" on that box.
Comment 4 Mike Gilbert gentoo-dev 2022-09-05 20:34:05 UTC
Have you tested newer versions of Portage? As of this writing, the latest release is 3.0.35.
Comment 5 Sebastian Pipping gentoo-dev 2022-09-05 22:08:25 UTC
I needed to unmerge repoman for that but fair point: same with portage 3.0.35, just tried; title updated.
Comment 6 Mike Gilbert gentoo-dev 2022-09-05 22:10:51 UTC
(In reply to Sebastian Pipping from comment #5)
> I needed to unmerge repoman for that

Please switch to using dev-util/pkgcheck and dev-util/pkgdev.
Comment 7 Mike Gilbert gentoo-dev 2022-09-05 22:19:11 UTC
portage 3.0.30-r3 and 3.0.30-r5 vary only by 3 patches:

3.0.30-revert-run-warn.patch
3.0.30-qa-checks.patch
3.0.30-loong-abis.patch

None of these patches touch any code that would affect dependency resolution.

Are you certain the behavior changed between these 2 versions? I don't see how that is possible.

If this truly is a regression, a bisect would be helpful.
Comment 8 Mike Gilbert gentoo-dev 2022-09-05 22:23:54 UTC
With current portage master, I get this when I run emerge -pv1 dev-lang/zig with sys-devel/lld-14 installed:

> % emerge -pv1 dev-lang/zig
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [ebuild  NS    ] sys-devel/llvm-13.0.1:13::gentoo [14.0.6-r2:14::gentoo] USE="binutils-plugin libffi ncurses xml -debug -doc -exegesis -libedit -test -xar -z3 (-verify-sig%)" ABI_X86="(64) -32 -x32" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k) (-VE*)" 0 KiB
> [ebuild     UD ] sys-devel/lld-13.0.1::gentoo [14.0.6::gentoo] USE="-debug -test (-verify-sig%)" 0 KiB
> [ebuild  NS    ] sys-libs/compiler-rt-13.0.1:13.0.1::gentoo [14.0.6-r1:14.0.6::gentoo] USE="clang -debug -test (-verify-sig%)" ABI_X86="32 (64)" 0 KiB
> [ebuild  NS    ] sys-libs/compiler-rt-sanitizers-13.0.1:13.0.1::gentoo [14.0.6:14.0.6::gentoo] USE="asan cfi clang dfsan gwp-asan hwasan libfuzzer lsan memprof msan orc profile safestack scudo tsan ubsan xray -debug (-shadowcallstack) -test (-verify-sig%)" ABI_X86="32 (64)" 0 KiB
> [ebuild  NS    ] sys-devel/clang-runtime-13.0.1:13.0.1::gentoo [14.0.6:14.0.6::gentoo] USE="compiler-rt openmp sanitize -libcxx" ABI_X86="32 (64) -x32" 0 KiB
> [ebuild  NS    ] sys-devel/clang-13.0.1:13::gentoo [14.0.6-r1:14::gentoo] USE="static-analyzer xml -debug -default-compiler-rt -default-libcxx -default-lld -doc -llvm-libunwind -test (-pie%*) (-verify-sig%)" ABI_X86="(64) -32 -x32" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k) (-VE*)" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9" 0 KiB
> [ebuild  N     ] dev-lang/zig-0.9.1::gentoo  USE="threads -test" 13,615 KiB
> 
> Total: 7 packages (1 downgrade, 1 new, 5 in new slots), Size of downloads: 13,615 KiB

sys-devel/lld is being downgraded, which appears to be the expected result.
Comment 9 Sebastian Pipping gentoo-dev 2022-09-05 22:43:28 UTC
I have added the word "binary" to the title in the meantime. It needs a binary package to show. A mix of source and binary made me fool myself earlier that this could be something new. To my best knowlegde now, all four versions of portage in the tree are affected with binary(!) packages and not affected with source(!) packages. Does that make sense?
Comment 10 Sebastian Pipping gentoo-dev 2022-09-05 22:45:25 UTC
PS: For me:

  # emerge -1av -kg =sys-devel/lld-14.0.6                                                                                           
  [..]
  These are the packages that would be merged, in order:                                                                                                                                       
                                                                                                                                                                                               
  Calculating dependencies... done!                                                                                                                                                            
  [binary     U  ] sys-devel/lld-14.0.6-1::gentoo [13.0.1::gentoo] USE="-debug -test -verify-sig%" 0 KiB                                                                                       
                                                                                                                                                                                               
  Total: 1 package (1 upgrade, 1 binary), Size of downloads: 0 KiB
  [..]
Comment 11 Mike Gilbert gentoo-dev 2022-09-05 23:22:57 UTC
(In reply to Sebastian Pipping from comment #10)

What happens if you add "--complete-graph=y" to that command?
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-05 23:50:21 UTC
Also, please share:
1. emerge -v1p dev-lang/zig -kg
2. emerge -pvc dev-lang/zig
Comment 13 Sebastian Pipping gentoo-dev 2022-09-06 00:03:37 UTC
(In reply to Mike Gilbert from comment #11)
> (In reply to Sebastian Pipping from comment #10)
> 
> What happens if you add "--complete-graph=y" to that command?

I have that in my default opts…

>> # portageq envvar EMERGE_DEFAULT_OPTS
>>  --keep-going --ask --verbose --complete-graph -j 3 --dynamic-deps y --verbose-conflicts

…but also re-verified with adding explicitly, same result:

>> # emerge -1av -kg --complete-graph=y =sys-devel/lld-14.0.6
>> [..]
>> These are the packages that would be merged, in order:
>> 
>> Calculating dependencies... done!
>> [binary     U  ] sys-devel/lld-14.0.6-1::gentoo [13.0.1::gentoo] USE="-debug -test -verify-sig%" 0 KiB
>> 
>> Total: 1 package (1 upgrade, 1 binary), Size of downloads: 0 KiB
Comment 14 Sebastian Pipping gentoo-dev 2022-09-06 00:08:35 UTC
(In reply to Sam James from comment #12)
> Also, please share:
> 1. emerge -v1p dev-lang/zig -kg

That would be:

>> # emerge -v1p dev-lang/zig -kg
>> [..]
>> Calculating dependencies... done!
>> [binary   R    ] dev-lang/zig-0.9.1-3::gentoo  USE="threads -test" 17,676 KiB
>> 
>> Total: 1 package (1 reinstall, 1 binary), Size of downloads: 17,676 KiB
>> 
>> !!! The following binary packages have been ignored due to non matching USE:
>> 
>>     =sys-libs/zlib-1.2.12-r3 -minizip
>> [..]

> 2. emerge -pvc dev-lang/zig

And:

>> # emerge -pvc dev-lang/zig
>> 
>> Calculating dependencies... done!
>>   dev-lang/zig-0.9.1 pulled in by:
>>     sys-fs/ncdu-2.1.2-r1 requires ~dev-lang/zig-0.9.1
>> 
>> >>> No packages selected for removal by depclean
>> Packages installed:   1757
>> Packages in world:    456
>> Packages in system:   43
>> Required packages:    1757
>> Number to remove:     0
Comment 15 Eric Joldasov 2022-09-06 01:36:48 UTC
Maybe try to change ">=sys-devel/lld-${LLVM_MAX_SLOT}" & "<sys-devel/lld-$((${LLVM_MAX_SLOT} + 1))" to "=sys-devel/lld-${LLVM_MAX_SLOT}*"? Like in Firefox ebuild
Comment 16 Mike Gilbert gentoo-dev 2022-09-06 03:15:04 UTC
I tried to reproduce this with local binpkgs, and was unable to do so.

> % sudo emerge -av1k --complete-graph=y sys-devel/lld
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [binary   R    ] sys-devel/lld-13.0.1-2::gentoo  USE="-debug -test" 0 KiB
> 
> Total: 1 package (1 reinstall, 1 binary), Size of downloads: 0 KiB
> 
> WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:
> 
> sys-devel/lld:0
> 
>   (sys-devel/lld-14.0.6-1:0/0::gentoo, binary scheduled for merge) USE="-debug -test -verify-sig" ABI_X86="(64)" conflicts with
>     <sys-devel/lld-14 required by (dev-lang/zig-0.9.1-1:0/0::gentoo, installed) USE="threads -test" ABI_X86="(64)"
>     ^              ^^

I do not have a binhost set up to test the --getbinpkg option.
Comment 17 Mike Gilbert gentoo-dev 2022-09-06 03:23:50 UTC
To test the --getbinpkg (-g) option, I set PKGDIR to a temporary directory, and pointed PORTAGE_BINHOST to the old PKGDIR via a file:// URL.

I got the same result as comment 16 when I ran "emerge -av1kg --complete-graph=y sys-devel/lld".
Comment 18 Mike Gilbert gentoo-dev 2022-09-06 03:32:37 UTC
I also tried removing the lld-14 binpkg from PKGDIR, and got similar results:

> % sudo emerge -av1k --complete-graph=y sys-devel/lld
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [binary   R    ] sys-devel/lld-13.0.1-2::gentoo  USE="-debug -test" 0 KiB
> 
> Total: 1 package (1 reinstall, 1 binary), Size of downloads: 0 KiB
> 
> WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:
> 
> sys-devel/lld:0
> 
>   (sys-devel/lld-14.0.6:0/0::gentoo, ebuild scheduled for merge) USE="-debug -test -verify-sig" ABI_X86="(64)" conflicts with
>     <sys-devel/lld-14 required by (dev-lang/zig-0.9.1-1:0/0::gentoo, installed) USE="threads -test" ABI_X86="(64)"
>     ^              ^^
Comment 19 Mike Gilbert gentoo-dev 2022-09-06 03:48:46 UTC
Adding --dynamic-deps=y had no effect either.
Comment 20 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-01-12 16:13:53 UTC
Per OP's description, this is invalid since LLD is slotted.  When ebuild requests two different LLD versions, it's expected that Portage satisfies both dependencies by installing two different slots.
Comment 21 Mike Gilbert gentoo-dev 2024-01-12 19:42:10 UTC
I think that the package was not slotted at the time this bug was reported.