Your message dated Sat, 21 Oct 2023 10:54:12 +0000
with message-id <e1qu9cs-00gohl...@fasolo.debian.org>
and subject line Bug#1053836: fixed in waffle 1.8.0-2
has caused the Debian Bug report #1053836,
regarding libwaffle-dev: missing dependency on libdrm-dev, required by 
waffle-1.pc
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1053836: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053836
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: libwaffle-dev
Version: 1.8.0-1
Severity: serious
Tags: patch
Justification: can easily cause FTBFS in related packages

waffle-1.pc now has a dependency on libdrm.pc, but the -dev package that
contains waffle-1.pc does not depend on libdrm-dev, leading to a build
failure similar to #987940, #987879, #986517 in locally-developed software
(in my case the steam-runtime-tools package in Valve's Steam Runtime,
I haven't verified whether piglit has the same problem).

Steps to reproduce
------------------

In a minimal chroot/container (I used podman), install libwaffle-dev
and try to link a trivial binary to it:

$ podman pull debian:sid-slim
$ podman run --rm -it debian:sid-slim
# apt install build-essential libwaffle-dev pkgconf
# cat > trivial.c <<'EOF'
#undef NDEBUG
#include <assert.h>
#include <waffle.h>
int main (void)
{
  assert (waffle_enum_to_string (WAFFLE_DONT_CARE) != NULL);
  return 0;
}
EOF
# gcc -otrivial trivial.c $(pkgconf --cflags --libs waffle-1)
# ./trivial

Expected result
---------------

The test binary compiles, links and runs successfully.

Actual result
-------------

> Package libdrm was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libdrm.pc'
> to the PKG_CONFIG_PATH environment variable
> Package 'libdrm', required by 'waffle-1', not found
> trivial.c:3:10: fatal error: waffle.h: No such file or directory

Workaround
----------

Install libdrm-dev, or explicitly build-depend on it in packages that
use waffle.

Solution
--------

libwaffle-dev should depend on libdrm-dev: see attached patch 0001-*
(it should be amended to fill in the bug number, which I can't know
in advance).

However, it no longer needs to depend on libudev-dev: 0002-*.

I would suggest adding some superficial autopkgtests, which are a
surprisingly effective way to detect this sort of packaging issue: if run
before upload, they would also have detected #987940, #987879 and #986517.
The attached patch 0003-* adds some tests that I originally developed
for the Steam Runtime - sorry I didn't get round to upstreaming these
until now.

Thanks,
    smcv

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-security'), (500, 
'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 6.5.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libwaffle-dev depends on:
ii  libegl-dev      1.6.0-1
ii  libgbm-dev      23.2.1-1
ii  libgl-dev       1.6.0-1
ii  libudev-dev     254.5-1
ii  libwaffle-1-0   1.8.0-1
ii  libwayland-dev  1.22.0-2.1
ii  libx11-xcb-dev  2:1.8.7-1

libwaffle-dev recommends no packages.

Versions of packages libwaffle-dev suggests:
pn  libwaffle-doc  <none>

-- no debconf information
>From 11a871f2a49939b00f0e36173c6adeaeec6b551a Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Thu, 12 Oct 2023 12:47:39 +0100
Subject: [PATCH 1/3] d/control: Add missing dependency libwaffle-dev ->
 libdrm-dev

libwaffle-dev contains waffle-1.pc, which has a Requires on libdrm;
therefore libwaffle-dev should depend on the package that contains
libdrm.pc, which is libdrm-dev.

I've verified that this is sufficient to allow a simple test program
to be linked to libwaffle in an otherwise minimal container.

Fixes: 5ab2d5a2 "d/control: Upstream replaced libudev dep with libdrm"
Closes: #-1
Signed-off-by: Simon McVittie <s...@collabora.com>
---
 debian/control | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 5e9470a..6d7279f 100644
--- a/debian/control
+++ b/debian/control
@@ -40,7 +40,8 @@ Package: libwaffle-dev
 Architecture: any
 Multi-Arch: same
 Section: libdevel
-Depends: libegl-dev,
+Depends: libdrm-dev,
+         libegl-dev,
          libgbm-dev,
          libgl-dev,
          libudev-dev,
-- 
2.42.0

>From c07071db1f68bdc17738115c4b106dfcc5c03896 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Thu, 12 Oct 2023 12:49:53 +0100
Subject: [PATCH 2/3] d/control: libwaffle-dev no longer needs to depend on
 libudev-dev

waffle-1.pc no longer depends on udev.pc.

Fixes: 5ab2d5a2 "d/control: Upstream replaced libudev dep with libdrm"
Signed-off-by: Simon McVittie <s...@collabora.com>
---
 debian/control | 1 -
 1 file changed, 1 deletion(-)

diff --git a/debian/control b/debian/control
index 6d7279f..1dcb1b6 100644
--- a/debian/control
+++ b/debian/control
@@ -44,7 +44,6 @@ Depends: libdrm-dev,
          libegl-dev,
          libgbm-dev,
          libgl-dev,
-         libudev-dev,
          libwaffle-1-0 (= ${binary:Version}),
          libwayland-dev,
          libx11-xcb-dev,
-- 
2.42.0

>From f58220bc366d3c4660febf782baf4ac8eebc23ed Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Thu, 12 Oct 2023 12:35:02 +0100
Subject: [PATCH 3/3] d/tests: Add superficial autopkgtests

Even superficial tests like these are surprisingly good at detecting
packaging issues, like a missing dependency on libdrm-dev.

Signed-off-by: Simon McVittie <s...@collabora.com>
---
 debian/tests/build   | 44 ++++++++++++++++++++++++++++++++++++++++++++
 debian/tests/control | 11 +++++++++++
 debian/tests/info    | 12 ++++++++++++
 3 files changed, 67 insertions(+)
 create mode 100755 debian/tests/build
 create mode 100644 debian/tests/control
 create mode 100755 debian/tests/info

diff --git a/debian/tests/build b/debian/tests/build
new file mode 100755
index 0000000..54f684c
--- /dev/null
+++ b/debian/tests/build
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Copyright © 2019-2023 Collabora Ltd.
+# SPDX-License-Identifier: BSD-2-Clause
+# (see debian/copyright)
+
+# Check that the library can be linked by using pkgconf in the most
+# obvious way.
+
+set -e
+set -u
+set -x
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
+CC="${CROSS_COMPILE}gcc"
+PKG_CONFIG="${CROSS_COMPILE}pkgconf"
+
+tempdir="$(mktemp -d)"
+cd "$tempdir"
+
+cat > trivial.c <<'EOF'
+#undef NDEBUG
+#include <assert.h>
+
+#include <waffle.h>
+
+int main (void)
+{
+  assert (waffle_enum_to_string (WAFFLE_DONT_CARE) != NULL);
+  return 0;
+}
+EOF
+
+# Deliberately word-splitting pkgconf output
+# shellcheck disable=SC2046
+"$CC" -o trivial trivial.c $("$PKG_CONFIG" --cflags --libs waffle-1)
+test -x trivial
+./trivial
+
+rm -fr "$tempdir"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..bb5ae64
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,11 @@
+Tests: build
+Restrictions: allow-stderr, superficial
+Depends:
+ build-essential,
+ libwaffle-dev,
+ pkgconf,
+
+Tests: info
+Restrictions: superficial
+Depends:
+ waffle-utils,
diff --git a/debian/tests/info b/debian/tests/info
new file mode 100755
index 0000000..58f3d7a
--- /dev/null
+++ b/debian/tests/info
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Copyright © 2019-2021 Collabora Ltd.
+# SPDX-License-Identifier: BSD-2-Clause
+# (see debian/copyright)
+
+set -eu
+
+# We don't actually check for a GL context here, because there's no
+# guarantee that the test system has working GL: we just check that
+# an executable linked to the shared library can run at all.
+wflinfo --help
-- 
2.42.0


--- End Message ---
--- Begin Message ---
Source: waffle
Source-Version: 1.8.0-2
Done: Jordan Justen <jljus...@debian.org>

We believe that the bug you reported is fixed in the latest version of
waffle, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1053...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jordan Justen <jljus...@debian.org> (supplier of updated waffle package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 21 Oct 2023 03:21:58 -0700
Source: waffle
Architecture: source
Version: 1.8.0-2
Distribution: unstable
Urgency: medium
Maintainer: Jordan Justen <jljus...@debian.org>
Changed-By: Jordan Justen <jljus...@debian.org>
Closes: 1053836
Changes:
 waffle (1.8.0-2) unstable; urgency=medium
 .
   [ Simon McVittie ]
   * d/control: Add missing dependency libwaffle-dev -> libdrm-dev
     (Closes: #1053836)
   * d/control: libwaffle-dev no longer needs to depend on libudev-dev
   * d/tests: Add superficial autopkgtests
Checksums-Sha1:
 843fedf2e0c4b4ed2bef40d87c3f1bf95122311e 2573 waffle_1.8.0-2.dsc
 b2c293478894df3289aa06f3fb2a07aa7d5f58e7 18244 waffle_1.8.0-2.debian.tar.xz
 dc6bf81003aa5f7693b9c3f774cb1fbd6db3d584 9608 waffle_1.8.0-2_source.buildinfo
Checksums-Sha256:
 30496bd433d8da3f488c786d64da8c503f0fa4553e988f4978b3806f713511d6 2573 
waffle_1.8.0-2.dsc
 10b8ef8b29c5123064e8f1c867328d0b14be505d3134f6b9e3053618f3c13ab4 18244 
waffle_1.8.0-2.debian.tar.xz
 6c05fe803a87e71688f60e2b770413394b08f927657b5b85e36e013f84db82e7 9608 
waffle_1.8.0-2_source.buildinfo
Files:
 fd59d1b7046a2e577ce0aaac9f147cee 2573 libs optional waffle_1.8.0-2.dsc
 e3fdfda5dd37a35fcd57afa1a827ff74 18244 libs optional 
waffle_1.8.0-2.debian.tar.xz
 e5d6cf3550076c5c5ec08102a0d9d965 9608 libs optional 
waffle_1.8.0-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwnSFIXQUyd8CMWwuN/mfaMr5kusFAmUzpzAACgkQN/mfaMr5
kuulHBAAoQXz3602gy2XhRP6Nn0AXzr+Kqh3hwXPlwlTBrZGK6EOkXXDeDMizByG
emAF6SJfB/WpsxRLGlJ+/qZTsmNrEkFhK8yylZxPlHRx9zxMXh0xWFBOzEK9SvZk
yUZTjXDPUHb4H9Rfzrv2zFmPBQRevNrHoo3eaYrq98P9lwIDJjtYjgzR8Z5mZuZw
DbfkCviOMRpuUPJjAMAilqoxgUo/ZC1L1EXRFUYVUACLxVSVG11iGBqZLllsG0Z0
D+/rkt9MvlyG9QbCSA9scCJlD66QKsU9uwhJm77WmA/WyRZ7fSeWqllG40K91y49
E0HH1P2Jeea5VzfOMVn19An749NdPzP3E0HzYn/Kv4OlwQJd+cXIBoQbXSW99w2+
8/I2JWtY58621bdEqQU+KIIoOAeq5z1hx2W8aShMdPLhFOiFzs7/1Qi60PMTaDED
N5zf+2Wd0EtjtboKsZGwXvJbm+t+Mix86flhVEPmkNNIYOOTw+yCX601NaXXFGrE
oEk2qlzCXI4M/i1J4F25rDrBkZPAhen9M67Kxr6cQWK/skBusYkCF4ht+uO+MUIf
cg1goZnFEjRq+qwVyU+unfr/f3UBF0Q7G4D2umCDnvlV6Jr9nopm5ubOuwxBIsku
nnI650u0zzaJdC8eX3LcWHYkU9YU9bl/iOUKN+wWnkBuhzjmLnA=
=PyzT
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to