Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890718 - dev-libs/libclc: invalid USE flags check
Summary: dev-libs/libclc: invalid USE flags check
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
Depends on:
Reported: 2023-01-13 17:40 UTC by Alexander Kurakin
Modified: 2023-01-13 21:51 UTC (History)
4 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kurakin 2023-01-13 17:40:51 UTC
After I changed VIDEO_CARDS I have:

$ eix dev-libs/libclc
[I] dev-libs/libclc
     Available versions:  14.0.6{tbz2} 15.0.6{tbz2} ***l **16.0.0_pre20230101 **16.0.0_pre20230107 ***l {spirv verify-sig VIDEO_CARDS="nvidia r600 radeonsi"}
     Installed versions:  15.0.6{tbz2}(17:50:37 01/13/23)(-spirv -verify-sig VIDEO_CARDS="-nvidia -r600 -radeonsi")

It became interesting to me what dev-libs/libclc does if all USE flags are turned off.

We have :

[[ ${#libclc_targets[@]} ]] || die "libclc target missing!"

But seems like it doesn't work.


1. libclc_targets is a list,
2. ${#libclc_targets[@]} is "0",
3. [[ ]] tests for an empty string in my hands.


BTW, is it really checked if "at least one USE flag is on"? It's REQUIRED_USE, then:

REQUIRED_USE="|| (spirv video_cards_nvidia video_cards_r600 video_cards_radeonsi)"
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-01-13 20:33:05 UTC
Well, yes, the code is wrong.  However, I'm not sure whether we should indeed enforce this via REQUIRED_USE or perhaps remove it entirely.

@x11, any opinion?  libclc is currently only used by mesa[opencl].  Is there a semi-valid use case for installing mesa[opencl] but not enabling any backend on libclc?

I'm particularly wondering whether:

a. it's better to enforce at least one backend, so that people notice if they're building libclc without any backend and wouldn't end up WTF-ing why something doesn't work, or

b. it's better to let people install libclc without any backend, so if it gets pulled in as a dependency but they don't need it, they don't have to go through special hassle.
Comment 2 Alexander Kurakin 2023-01-13 21:51:29 UTC
Sorry about my foreign opinion but isn't more important whether the upstream allows such situation? (Mistakenly or not -0 is another question.) I perceive Gentoo as close-to-upstream (a source-based distribution).