Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936625 - sys-apps/portage - --getbinpkgonly does not respect abi_x86_32 useflag
Summary: sys-apps/portage - --getbinpkgonly does not respect abi_x86_32 useflag
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-25 12:05 UTC by Fab
Modified: 2024-07-27 19:15 UTC (History)
4 users (show)

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


Attachments
emerge -av1 --getbinpkgonly sys-devel/clang:18 (out.txt,1.31 KB, text/plain)
2024-07-25 22:53 UTC, Fab
Details
emerge -av1 --getbinpkg sys-devel/clang:18 (out.txt,1.32 KB, text/plain)
2024-07-25 23:02 UTC, Fab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fab 2024-07-25 12:05:24 UTC
Hi,

Some time ago, I installed from binary repository these binary packages and related deps :
 - sys-devel/llvm:17
 - sys-devel/clang:17
Everything went fine.

Today, sys-devel/llvm:18 and sys-devel/clang:18 are stabilized.
I did the same, and again, everything went fine.

Until I run the next emerge update : emerge wants to rebuild llvm and clang packages to turn on the xml useflag :

> # emerge -avuDU @world
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> Dependency resolution took 54.28 s (backtrack: 0/20).
> 
> [ebuild     U  ] sys-devel/llvm-common-18.1.8::gentoo [17.0.6::gentoo] USE="-emacs -verify-sig" 0 KiB
> [ebuild   R    ] sys-devel/llvm-18.1.8-r1:18/18.1::gentoo  USE="binutils-plugin libffi ncurses xml* zstd -debug -debuginfod -doc -exegesis -libedit -test -verify-sig -z3" ABI_X86="32* (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" 272 KiB
> [ebuild  NS    ] dev-util/spirv-llvm-translator-18.1.2:18::gentoo [17.0.0-r2:17::gentoo] USE="-test" 1 656 KiB
> [ebuild   R    ] sys-devel/clang-18.1.8:18/18.1::gentoo  USE="extra (pie) static-analyzer xml* -debug -doc (-ieee-long-double) -test -verify-sig" ABI_X86="32* (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 (-python3_13)" 0 KiB
> 

xml useflag is coming from the desktop profile.

Why llvm:17 and clang:17 binary packages are built with xml on and llvm:18 and clang:18 binary packages are not ?
Thank you.
Comment 1 Fab 2024-07-25 22:06:39 UTC
To be more precise, the llvm:17 and clang:17 packages I installed were :
> # sha1sum /var/cache/binpkgs/sys-devel/llvm/llvm-17.0.6-5.gpkg.tar
> 89bcfc3ca3d802d5e86eff4e36e83ed79b2b8633  /var/cache/binpkgs/sys-devel/llvm/llvm-17.0.6-5.gpkg.tar
> 
> # sha1sum /var/cache/binpkgs/sys-devel/clang/clang-17.0.6-5.gpkg.tar 
> d2034ccc24993382966fd16ecef31a2ef0cad425  /var/cache/binpkgs/sys-devel/clang/clang-17.0.6-5.gpkg.tar
> 

Those packages are built with useflags xml and abi_x86_32 on.


When installing following llvm:18 and clang:18 packages :
> # sha1sum /var/cache/binpkgs/sys-devel/llvm/llvm-18.1.8-r1-3.gpkg.tar 
> 37dad6f68f374945ac5da2b6f9f5d47741684f89  /var/cache/binpkgs/sys-devel/llvm/llvm-18.1.8-r1-3.gpkg.tar
> 
> # sha1sum /var/cache/binpkgs/sys-devel/clang/clang-18.1.8-3.gpkg.tar 
> f2f2c820474fe6b8f9f516cc80a7f32a8264ce02  /var/cache/binpkgs/sys-devel/clang/clang-18.1.8-3.gpkg.tar
> 
Useflags xml and abi_x86_32 are off.

Why this difference ?
Comment 2 Fab 2024-07-25 22:53:53 UTC
Created attachment 898322 [details]
emerge -av1 --getbinpkgonly sys-devel/clang:18

I think I found something. I uninstalled clang and llvm packages just to test.

Now I'm asking emerge to reinstall them from binary host. Attached file is the output.

The problem : in my make.conf I have abi_x86_32 useflag in my USE.
You can see that emerge wants to install the packages with 32bit ABI off :
> ABI_X86="(64) -32 (-x32)"

It seems to me that emerge is selecting the wrong binary package.
Comment 3 Fab 2024-07-25 23:02:19 UTC
Created attachment 898323 [details]
emerge -av1 --getbinpkg sys-devel/clang:18

With --getbinpkg instead of --getbinpkgonly it selects the packages with 32 ABI on.
Comment 4 Fab 2024-07-27 12:24:12 UTC
Please reassign to portage team. For me this is an emerge bug :
--getbinpkgonly does not respect abi_x86_32 useflag.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-27 12:52:58 UTC
(In reply to Fab from comment #4)
> Please reassign to portage team. For me this is an emerge bug :
> --getbinpkgonly does not respect abi_x86_32 useflag.

--getbinpkgonly doesn't respect _any_ USE flags. See bug 934962.

What we _could_ do is adjust the scoring so that we prefer disabling/ignoring flags which are set on fewer packages.
Comment 6 Fab 2024-07-27 15:06:55 UTC
Ok, I understand this behavior better.

Why did I use the --getbinpkgonly in the first place ?

Last update of media-libs/mesa with VIDEO_CARDS="intel" pulls-in dev-libs/libclc, then lvm and clang. In FEATURES I have *buildpkg*. I started my world update as usual when I realized that llvm and clang would take too long to build, so I stopped the world update process, I removed (emerge -Ca) manually the already built few dependencies related to llvm and clang, and I started a new emerge process to install only clang :
> emerge -av1 --getbinpkgonly sys-devel/clang:18

Why only ? because emerge had already built binary packages for the dependencies that I removed above, but I would prefer to use binary packages from binhost for them, and that's exactly what the man page entry is saying :
> --getbinpkgonly [ y | n ], -G
>   This option is identical to -g, as above, except binaries from the remote
>   server are preferred over local  packages  if  they are not identical.

I didn't imagine that emerge would not respect useflags configuration.
Comment 7 Zac Medico gentoo-dev 2024-07-27 19:15:33 UTC
(In reply to Fab from comment #6)
> I didn't imagine that emerge would not respect useflags configuration.

It is not a sensible default since the introduction of gentoo binhosts which contain a mixture of packages built for different profiles, rather than a separate binhost per profile.