On Wed, Feb 01, 2023 at 04:46:14PM +0100, Guido Günther wrote:
> Hi,
> On Wed, Feb 01, 2023 at 04:37:37PM +0100, Andreas Henriksson wrote:
[...]
> > FWIW here are some examples of autopkgtest for checking if pkg-config
> > works for your own -dev packages:
> > https://sources.debian.org/src/util-linux/2.38.1-4/debian/tests/
> 
> We have tests for that like ages:
> 
>   
> https://salsa.debian.org/swaywm-team/wlroots/-/blob/debian/latest/debian/tests/
> 
> It just won't trigger if you don't need the vulkan renderer. Feel free
> to submit a patch that exercises that as well.

Not sure why your tests doesn't catch this then.

You can reproduce this as simple as this:

1. start with a clean sid chroot (eg. `pbuilder login`)
2. add experimental to /etc/apt/sources.list
3. apt update
4. apt install libwlroots-dev/experimental
5. pkg-config --cflags wlroots

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 'wlroots', not found

There's nothing vulkan specific about my clean chroot.
Anyone trying to use `pkg-config --cflags wlroots` should see it
exit with 1 (error).


FWIW here's what I get when I launch your tests in my chroot:

```
# ls -l
total 8
-rwxr-xr-x 1 root root 248 Feb  1 16:30 build-test
-rw-r--r-- 1 root root 300 Feb  1 16:30 test.c
# ./build-test 
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 'wlroots', not found
gcc  test.c -lwlroots  -lwayland-server
Build test of test.c succeeded
WLR_BACKENDS=headless ./a.out
00:00:00.000 [backend/backend.c:297] Loading user-specified backends due to 
WLR_BACKENDS: headless
00:00:00.000 [backend/headless/backend.c:68] Creating headless backend
```

So it doesn't seem like your test-case actually catches the pkg-config
exit code (and apparently the build still succeeds without cflags).

Regards,
Andreas Henriksson

Reply via email to