-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downstream packaging best practices in combination with Vulkan-Headers #1463
Comments
Apologies for the delayed response. To reiterate the problem to say what I think the 'problem' being asked is: Vulkan-Headers lacks a .pc file, Vulkan-Loader provides on for itself and Vulkan-Headers, and there is no clear solution package managers should employ for packaging both repos. I naively thought making the loader depend on the headers was the best option, but then I remembered that vulkan-loader is for running while vulkan-headers is for building. All Vulkan apps need the loader to run, only people building vulkan apps need the headers. It is very confusing to see the headers be a requirement for a binary only package. That said, apps that link to the loader do need both headers & binary. Debian having a libvulkan1 (loader) and a libvulkan1-dev (headers) packages makes sense to me as a user. Whether that workflow is a lot of extra steps for package maintainers I do not know. I really am unable to say which is the 'best' solution. Part of the issue is inconsistently providing vulkan.pc - maybe Vulkan-Headers should provide its own so package maintainers can use those. But I do not know enough of the pkg-config workflow or best practices to really offer a strong recommendation for any of the above solutions. |
Thinking things through, I believe the root of the cause is the 2018 split of the Vulkan-LoaderAndValidationLayers "monorepo" into its constituent parts (loader, headers, validation layers, tools). The archived repo has https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/vulkan.pc.in which is the origin of vulkan.pc. Back when there was only one 'repo' to package. I believe there needs to be a vulkan-loader.pc and a vulkan-headers.pc, and deprecate vulkan.pc (which attempts to do both things, and does so poorly). |
This is the runtime vs buildtime split that Linux distros tend to do. In those cases, the runtime doesn't need a pkgconfig file, because pkgconfig is only used for build-time dependency tracking. So it sounds to me like the pc file should just be moved into the headers repository. Does anyone ever build against the loader but without the headers? I don't think building against the headers without the loader is possible because it involves linking against the library provided by the loader. |
There is no requirement for apps to link to the loader when building. They can set VK_NO_PROTOTYPES and load all functions at runtime (or use a library like Hence why its a good reason to have a separate vulkan-loader.pc and vulkan-headers.pc. If you only need headers to build, just use vulkan-headers.pc. If you are linking to the loader, then you need vulkan-loader.pc and then to get the headers use vulkan-headers.pc. This mirrors the fact that the repo is Vulkan-Loader now as well. I advocate not changing vulkan.pc, as breaking users by changing it (to remove the headers) is bad. Keeping it around but mark it as deprecated would be idea. |
That makes sense. I think it's not the default and the default is what vulkan.pc does? |
We have the problem that Vulkan-Loader contains the pkg-config file, which some project use for detecting how to build against vulkan, while the headers are in the separate https://github.com/KhronosGroup/Vulkan-Headers project. This results in downstream packages needing to do extra check for headers etc.
In Arch Linux for example loader and headers are separate packages, resulting in build issues:
mesonbuild/meson#7956
In MSYS2 we follow what Arch does, leading to the same issue:
mesonbuild/meson#13016
Some downstream projects work around that by manually checking for headers:
https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/3fc66d4525916b9301236a000a6ed03311ed25a7/render/vulkan/meson.build#L17-25
In Debian the packages are built together and the development files are split out into a separate combined package (so the .pc files and the headers are together) https://packages.debian.org/source/trixie/vulkan-loader
What would be a good strategy to handle this split downstream?
Thanks!
The text was updated successfully, but these errors were encountered: