[Pkg-utopia-maintainers] Bug#979442: libdaemon: Please make autopkgtests cross-test-friendly

Steve Langasek steve.langasek at canonical.com
Wed Jan 6 18:52:14 GMT 2021


Package: libdaemon
Version: 0.14-7.1
Severity: minor
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu hirsute ubuntu-patch

Hi Michael,

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.

The libdaemon tests currently fail in this environment, because there is a
build test that does not invoke the toolchain in a cross-aware manner.  I've
verified that the attached patch lets the tests successfully build i386
tests on an amd64 host.

Note that upstream autopkgtest doesn't currently set DEB_HOST_ARCH so this
is a complete no-op in Debian for the moment.  Support for cross-testing in
autopkgtest is currently awaiting review at
https://salsa.debian.org/ci-team/autopkgtest/merge_requests/69 and once
landed, will still have no effect unless autopkgtest is invoked with a '-a'
option.  So this change should be safe to land in your package despite this
not being upstream in autopkgtest.

Thanks for considering,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru libdaemon-0.14/debian/tests/build libdaemon-0.14/debian/tests/build
--- libdaemon-0.14/debian/tests/build	2018-04-27 04:35:47.000000000 -0700
+++ libdaemon-0.14/debian/tests/build	2021-01-04 13:07:47.000000000 -0800
@@ -5,6 +5,14 @@
 
 cd "${AUTOPKGTEST_TMP:-"${ADTTMP}"}"
 
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CC="$DEB_HOST_GNU_TYPE-gcc"
+    PKGCONFIG="$DEB_HOST_GNU_TYPE-pkg-config"
+else
+    CC=gcc
+    PKGCONFIG=pkg-config
+fi
+
 cat > trivial.c <<'EOF'
 #include <stdio.h>
 
@@ -16,7 +24,7 @@
 }
 EOF
 
-gcc -o trivial trivial.c $(pkg-config --cflags --libs libdaemon)
+"$CC" -o trivial trivial.c $("$PKGCONFIG" --cflags --libs libdaemon)
 test -x trivial
 ./trivial
 echo "# everything seems OK"


More information about the Pkg-utopia-maintainers mailing list