You are not logged in.

#1 2023-07-02 07:06:34

EinloggenNervt
Member
Registered: 2023-07-02
Posts: 4

Arch packages and pkg-config question

So I reported a bug almost exactly one year ago (Really weird it was closed exactly one year after report ... ^^)

https://bugs.archlinux.org/task/75022

And it got rejected.
It is defenitely partially my fault. I don't personally use Arch Linux, so i just looked at the difference to the package shipping between debian and arch, and thought they simply have to ship an extra package. (Again this was my fault here, arch simplifies this step a lot).

Still it reports a legit bug:
"it ships vulkan-dev and the vulkan runtime in one package without adding vulkan-headers as a "must have" depedency"

Or to rephrase:
it ships the vulkan development libraries and pkg-config, but does not depend on vulkan-headers. (which leads pkg-config to think vulkan is correctly installed. But without headers, I can't compile ofc)

This is IMHO a fatal problem. It's not uncommon to rely on pkg-config to find development libraries with cmake.
"pkg-config is a computer program that defines and supports a unified interface for querying installed libraries for the purpose of compiling software that depends on them."
https://en.wikipedia.org/wiki/Pkg-config

So my question is. Does arch not care about this generally. Am i the wrong here?
To me this is a clear bug in what a package manager should do.

I hope it's ok i posted it here, because I also don't want to annoy the package maintainers too much, as said, I am not sure, if I'm wrong. But to me this sounds like a legit bug and this is why I reported it, and it was closed without a notice from the package maintainer :/

Kind regards

Last edited by EinloggenNervt (2023-07-02 07:09:05)

Offline

#2 2023-07-02 10:30:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,893

Re: Arch packages and pkg-config question

Archlinux tries to stay close to upstream , for vulkan the Khronos Group is upstream .

Khronos has separate locations for the sources of  vulkan headers and vulkan loader  . Each has their own issue & MR tracker .

Does debian have 2 packages and a a 3rd that combines them ?


Welcome to archlinux forums.

Last edited by Lone_Wolf (2023-07-02 10:34:25)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-07-02 11:40:50

EinloggenNervt
Member
Registered: 2023-07-02
Posts: 4

Re: Arch packages and pkg-config question

Debian has -dev packages

The dev package contains the header files aswell as the pkg-config:
https://packages.debian.org/de/trixie/a … v/filelist

additionally it depends on libvulkan1, so the loader binary.
so the header files are never shipped without the development libraries when pkg-config files is shipped.

So yeah their handling is a bit different generally, but i can assume header files are installed when the pkg-config file is present there

Offline

#4 2023-07-02 13:05:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Arch packages and pkg-config question

1. Why do you think a .pc file is the relevant test-case for whether dependencies for building software are met?  That just doesn't follow at all.

2. If you want your concerns addressed, stop relying on the questionable logic of #1 above and on comparisons with other distros.  Outline your concern directly.  I'm guessing you must maintain some software that you'd like to ensure can build successfully on arch, right? (if not why would this concern you at all).

If you maintain software that you want to help ensure can build on various distros, A) thank you for making the software, and B) thank you more for trying to cooperate with distro packaging.  But let's focus on what's failing, not what you think is the solution to that failure ... as right now this is clearly an X-Y problem: you think that asking arch linux to include header files in the same package as the .pc file is the solution to some problem.  It's clearly not the right solution for arch, but there can be some other solution.  However, we can't get to that solution unless we know what the actual problem is.

EinloggenNervt wrote:

i can assume header files are installed when the pkg-config file is present there

If we're assuming, we can have a lot more fun that that!  But that's not a reliable way to go about software development.  When one lists dependencies, they should not list "vulkan.pc" and assume that this means headers are also present.  If the headers are required, list them as a dependency and let downstream packagers identify which distro packages meet those needs.  If you really say that all that is needed is "vulkan.pc" then you can't really complain if a downstream packager only includes the package that includes that file and nothing else that you've assumed would come along with it.

Last edited by Trilby (2023-07-02 13:09:36)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-07-02 14:15:43

EinloggenNervt
Member
Registered: 2023-07-02
Posts: 4

Re: Arch packages and pkg-config question

You are right, I'll try to display the problem more generally:

A custom cmake module is used to detect if vulkan is installed:

```
  find_package(PkgConfig QUIET)
  pkg_check_modules(PC_VULKAN vulkan)
  # do something with PC_VULKAN_INCLUDE_DIRS PC_VULKAN_LIBRARIES
```

So we use pkg-config to detect for vulkan support. Which also works on Arch without any problem. But since the vulkan-header files are no hard dependency, we cannot assume the headers are installed. Without doing arch specific checks, cmake will not detect that the package is not installed. the vulkan-header has not .pc file and is no dependency.

Even tho our README clearly says you need vulkan headers installed, it happened that there were arch users who apparently build the software from source and any package, got a build error, but not during cmake, where we'd say "vulkan packages are not installed", but instead during compilation "could not find vulkan.h".

This error is not directly helpful ofc, The maintainers didn't assume the headers are not installed, and the user thought our package detection is broken (or whatever).

So the main problem is, we cannot _cleanly_ detect the failure at setup.

So yes. To my understanding the wikipedia quote also implies that this should be possible and in my assumption the .pc file can be used as a way to verify the existence of the dependency:
"pkg-config is a computer program that defines and supports a unified interface for querying installed libraries for the purpose of compiling software that depends on them."

Offline

#6 2023-07-02 14:27:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Arch packages and pkg-config question

EinloggenNervt wrote:

Even tho our README clearly says you need vulkan headers installed, it happened that there were arch users who apparently build the software from source and any package, got a build error

That's on them.  They've screwed up at multiple points.  1) they failed to read the README (the name's a dead give-away with what one is supposed to do with such a file) and 2) they are trying to build from source on arch without a PKGBUILD which is typically a bad approach.  Fool-proofing your software is futile - you'll never keep up with the fools.

But to include some perhaps more helpful or earlier error messages, wouldn't an AC_CHECK_HEADERS be more suitable?  (Bear in mind I know next to nothing about cmake, so sorry if this is the wrong approach ... I suspect there must be something better than just checking for the .pc file though).  The vulkan-headers package includes VulkanHeadersConfig.cmake and a couple other cmake files ... I'm not sure if they're relevant for such checks.

Last edited by Trilby (2023-07-02 14:28:44)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2023-07-02 14:47:49

EinloggenNervt
Member
Registered: 2023-07-02
Posts: 4

Re: Arch packages and pkg-config question

Maybe I am overthinking this indeed, now that some time passed, c23 has a __has_include standardized, c++ already has it since c++17
https://en.cppreference.com/w/c/preprocessor/include

I guess I'll just go with that. I also don't know if pkg-config is the ultimate correct approach here, cmake also has FindVulkan modules (https://cmake.org/cmake/help/v3.27/modu … ulkan.html) but only with newer versions.
It was probably mostly about the counter intuitively, since we use pkg-config for basically every dependency and it worked just fine..
But vulkan is maybe simply a special case, where the headers and libraries are separated. This can also make sense if the library is lazy loaded or similar.

Thanks for your answers, i appreciate the fast responses in this forum. If you are a moderator you can tag this discussion as resolved.
Have a great day

Offline

#8 2023-07-02 15:03:45

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Arch packages and pkg-config question

EinloggenNervt wrote:

cmake also has FindVulkan modules (https://cmake.org/cmake/help/v3.27/modu … ulkan.html) but only with newer versions.

As Trilby pointed out, vulkan-headers (Arch) provides VulkanHeadersConfig.cmake and Debian's libvulkan-dev also has that. Have you looked into that?

Thanks for your answers, i appreciate the fast responses in this forum. If you are a moderator you can tag this discussion as resolved.

You can prepend [SOLVED] to the title by editing your first post.

Last edited by Raynman (2023-07-02 15:03:59)

Offline

Board footer

Powered by FluxBB