Bug#968684: libqb: Please make autopkgtests cross-test-friendly
On Sat, Aug 22, 2020 at 07:14:57PM +0200, wf...@niif.hu wrote: > On Wed, 19 Aug 2020 14:04:15 -0700 Steve Langasek > 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) Yes, this looks like it should behave correctly for both the cross and native cases (for Debian and Ubuntu). Cheers, -- 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/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: PGP signature
Bug#968684: libqb: Please make autopkgtests cross-test-friendly
On Wed, 19 Aug 2020 14:04:15 -0700 Steve Langasek 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 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
Bug#968684: libqb: Please make autopkgtests cross-test-friendly
Package: libqb Version: 1.0.6-1 Severity: minor Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu groovy ubuntu-patch Dear maintainers, 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 libqb tests currently fail in this environment, because they are build tests that do not invoke the toolchain in a cross-aware manner, and do not declare their test dependencies in a cross-friendly matter. 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/ slanga...@ubuntu.com vor...@debian.org diff -Nru libqb-1.0.6/debian/tests/control libqb-1.0.6/debian/tests/control --- libqb-1.0.6/debian/tests/control2020-07-30 10:12:44.0 -0700 +++ libqb-1.0.6/debian/tests/control2020-08-19 13:54:37.0 -0700 @@ -1,3 +1,3 @@ -Depends: libqb-dev, gcc, libc6-dev, pkg-config +Depends: libqb-dev, build-essential, libc6-dev, pkg-config Tests: ipc Restrictions: allow-stderr diff -Nru libqb-1.0.6/debian/tests/ipc libqb-1.0.6/debian/tests/ipc --- libqb-1.0.6/debian/tests/ipc2020-07-30 11:31:35.0 -0700 +++ libqb-1.0.6/debian/tests/ipc2020-08-19 13:59:43.0 -0700 @@ -1,14 +1,22 @@ #!/bin/sh -ex +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 + 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" $("$PKGCONFIG" --cflags libqb) \ -o ipcserver ipcserver.c \ -$(pkg-config --libs libqb) -gcc $(pkg-config --cflags libqb) \ +$("$PKGCONFIG" --libs libqb) +"$CC" $("$PKGCONFIG" --cflags libqb) \ -o ipcclient ipcclient.c \ -$(pkg-config --libs libqb) +$("$PKGCONFIG" --libs libqb) OUT="${AUTOPKGTEST_ARTIFACTS:-.}/out.txt" ERR="${AUTOPKGTEST_ARTIFACTS:-.}/err.txt"