[Debian-ha-maintainers] Bug#968684: libqb: Please make autopkgtests cross-test-friendly

wferi at niif.hu wferi at niif.hu
Sat Aug 22 18:14:57 BST 2020


On Wed, 19 Aug 2020 14:04:15 -0700 Steve Langasek <steve.langasek at canonical.com> wrote:

> In Ubuntu, we have moved the i386 architecture to a compatibility-only layer
> on amd64, and therefore we are also moving our autopkgtest infrastructure to
> test i386 binaries in a cross-environment.
> 
> This requires changes to some tests so that they are cross-aware and can do
> the right thing.

Hi,

Would the following change work for Ubuntu?  I find using a single code
path slightly cleaner.
(https://salsa.debian.org/ha-team/libqb/-/commit/21c2e77428fa0e2bba35b43523a7af028bc3e676)

commit 21c2e77428fa0e2bba35b43523a7af028bc3e676 (HEAD -> debian/crosstest, salsa/debian/crosstest)
Author: Ferenc Wágner <wferi at debian.org>
Date:   Sat Aug 22 18:30:57 2020 +0200

    Make our autopkgtest cross-test-friendly

diff --git a/debian/tests/control b/debian/tests/control
index 35c6ed9a..0354a969 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,5 @@
-Depends: libqb-dev, gcc, libc6-dev, pkg-config
+Depends: libqb-dev,
+ build-essential,
+ pkg-config,
 Tests: ipc
 Restrictions: allow-stderr
diff --git a/debian/tests/ipc b/debian/tests/ipc
index e24cf411..baec3e8e 100755
--- a/debian/tests/ipc
+++ b/debian/tests/ipc
@@ -1,14 +1,18 @@
 #!/bin/sh -ex
 
+DEB_HOST_GNU_TYPE=$(dpkg-architecture -q DEB_HOST_GNU_TYPE)
+CC=$DEB_HOST_GNU_TYPE-gcc
+PKG_CONFIG=$DEB_HOST_GNU_TYPE-pkg-config
+
 cd examples
 # the os_base.h in-tree header includes inttypes.h for the examples
 ln -sf /usr/include/inttypes.h os_base.h # -f to enable repeated runs
-gcc $(pkg-config --cflags libqb) \
+$CC $($PKG_CONFIG --cflags libqb) \
     -o ipcserver ipcserver.c \
-    $(pkg-config --libs libqb)
-gcc $(pkg-config --cflags libqb) \
+    $($PKG_CONFIG --libs libqb)
+$CC $($PKG_CONFIG --cflags libqb) \
     -o ipcclient ipcclient.c \
-    $(pkg-config --libs libqb)
+    $($PKG_CONFIG --libs libqb)
 
 OUT="${AUTOPKGTEST_ARTIFACTS:-.}/out.txt"
 ERR="${AUTOPKGTEST_ARTIFACTS:-.}/err.txt"
-- 
Feri



More information about the Debian-ha-maintainers mailing list