Bug#974171: marisa: Please make autopkgtests cross-test-friendly
Package: marisa
Version: 0.2.6-1
Severity: minor
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu hirsute 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 marisa 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@ubuntu.com vorlon@debian.org
diff -Nru marisa-0.2.6/debian/tests/build marisa-0.2.6/debian/tests/build
--- marisa-0.2.6/debian/tests/build 2020-06-30 06:53:01.000000000 -0700
+++ marisa-0.2.6/debian/tests/build 2020-11-10 14:15:46.000000000 -0800
@@ -1,6 +1,14 @@
#!/bin/sh
set -e
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+ CXX="$DEB_HOST_GNU_TYPE-g++"
+ PKGCONFIG="$DEB_HOST_GNU_TYPE-pkg-config"
+else
+ CXX=g++
+ PKGCONFIG=pkg-config
+fi
+
echo "=== build ==="
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
@@ -28,7 +36,7 @@
}
__EOF__
-g++ -o marisatest marisatest.cpp `pkg-config --cflags --libs marisa`
+"$CXX" -o marisatest marisatest.cpp `"$PKGCONFIG" --cflags --libs marisa`
echo "build: OK"
[ -x marisatest ] && ./marisatest
echo "run: OK"
Reply to: