Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951125 - media-libs/libplacebo-7.349.0: vulkan useflag does not seem to fully disable it
Summary: media-libs/libplacebo-7.349.0: vulkan useflag does not seem to fully disable it
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ionen Wolkens
URL: https://github.com/mesonbuild/meson/i...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-10 13:36 UTC by NRK
Modified: 2025-03-11 23:07 UTC (History)
3 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 NRK 2025-03-10 13:36:10 UTC
It seems that the vulkan useflag in libplacebo doesn't fully disable vulkan.

To reproduce:

1. Install media-libs/vulkan-loader and have it present in your system.
2. Disable vulkan useflag for libplacebo
3. Install libplacebo
4. Notice that the libplacebo.pc file includes `Requires.private: vulkan`.

To observe the correct behavior:

1. Uninstall vulkan, make sure it's not present in your system.
2. Install libplacebo
3. Notice that the libplacebo.pc no longer contains the private requirement on vulkan.

I haven't dug into whether it's just a "bug" with the pc file or goes deeper than that.
Comment 1 Ionen Wolkens gentoo-dev 2025-03-10 13:57:03 UTC
Good to know (messy) but I think we can ignore it, these would only be used when attempting to link statically but we don't provide the static lib and nothing should be attempting that.

And libplacebo itself is still not linking with it, it's "probably" just some logic error with the pkgconfig generation (wouldn't be the first time it has problems with that).

$ pkg-config --libs libplacebo
-lplacebo

$ pkg-config --libs --static libplacebo
-lplacebo -lm -pthread -ldl -lshaderc_shared -lvulkan -llcms2 -llcms2_fast_float -llcms2_threaded -pthread -lm

If concerned by the inconsistency, can always try to get it fixed upstream though.
Comment 2 NRK 2025-03-10 17:39:19 UTC
If you have a system where libplacebo.pc is privately requiring vulkan, but vulkan has since then been uninstalled (obviously allowed since portage isn't counting it as a dependency as libplacebo was built with -vulkan) then libplacebo pkg-config is broken *even if* `--static` is not specified.

	~> grep 'vulkan' /usr/lib64/pkgconfig/libplacebo.pc
	pl_has_vulkan=0
	Requires.private: vulkan
	~> pkgconf --libs libplacebo   
	Package vulkan was not found in the pkg-config search path.
	Perhaps you should add the directory containing `vulkan.pc'
	to the PKG_CONFIG_PATH environment variable
	Package 'vulkan', required by 'libplacebo', not found
	~> pkgconf --version
	2.4.3

There's a bit more discussion about it here if you'd want to follow along:
https://lists.sr.ht/~skeeto/public-inbox/%3Ccyzr422npxkldaoirrrelwsronyetppusxewb4y4yo5p7olnky@zwqe36nsd4tp%3E#%3Ckrmpupuaclniq7bpprqsu2mr4j6uhm2fa5xhprmuk3jakcfwnu@2qbm2qbgbarr%3E

And this arguably can be considered a pkgconf regression, but regardless I don't think we should just "ignore it" since in practice, it means the user's system ends up borked (regardless of whether they use `--static` or not).
Comment 3 Ionen Wolkens gentoo-dev 2025-03-10 17:54:55 UTC
Oh right, I forgot that pkgconf can complain -- did have issues with that before.
Comment 4 Ionen Wolkens gentoo-dev 2025-03-10 18:04:07 UTC
Not familiar with partial_dependency() but I think? it gets combined here, vulkan-headers are always required (hard dependency) but it adds in vulkan-loader to it:

    vulkan_loader = dependency('vulkan', required: false)
    vulkan_headers = vulkan_loader.partial_dependency(includes: true, compile_args: true)

    ...

    build_deps += vulkan_headers

^ build_deps are added as-is to pkgconfig deps

The rest (for linking) has actual guards:

    if vulkan_build.allowed()
    ...
      if vulkan_link.allowed()
        build_deps += vulkan_loader
Comment 5 Ionen Wolkens gentoo-dev 2025-03-10 18:07:18 UTC
No real time atm due to priorities, but might mess with it a bit later, or be lazy and just sed vulkan out of the pkg-config until sorted out upstream.
Comment 6 Ionen Wolkens gentoo-dev 2025-03-11 22:06:51 UTC
(In reply to Ionen Wolkens from comment #4)
> Not familiar with partial_dependency() but I think? it gets combined here,
> vulkan-headers are always required (hard dependency) but it adds in
> vulkan-loader to it:
> 
>     vulkan_headers = vulkan_loader.partial_dependency(includes: true,
> compile_args: true)
Not sure but apparently issue is on meson's side? CC ztrawhcse

https://github.com/mesonbuild/meson/issues/11080

fwiw libplacebo upstream normally uses bundled vulkan-headers which does not have this problem
Comment 7 Larry the Git Cow gentoo-dev 2025-03-11 23:07:06 UTC
The bug has been closed via the following commit(s):

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

commit 71df98450bf4ca3dbd143cb48ba747ae670027fa
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2025-03-11 22:46:14 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2025-03-11 23:06:14 +0000

    media-libs/libplacebo: workaround vulkan leaking into .pc
    
    Is a bit of a edge case, so skipping revbump.
    
    Would've been simpler to patch the meson.build to handle
    all cases but ah well, at least won't need to rebase.
    
    Closes: https://bugs.gentoo.org/951125
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 media-libs/libplacebo/libplacebo-7.349.0.ebuild | 10 ++++++++++
 media-libs/libplacebo/libplacebo-9999.ebuild    | 10 ++++++++++
 2 files changed, 20 insertions(+)