On Mon, 26 Aug 2019 at 15:50:52 +0300, Jussi Pakkanen wrote: > On Mon, Aug 26, 2019 at 1:06 PM Simon McVittie <s...@debian.org> wrote: > > > They are meant to be created by a dpkg trigger (as symlinks to > > /usr/share/pkg-config-crosswrapper) when you add the armhf architecture: > > > > You usually need to add the foreign architecture to dpkg for > > cross-compilation anyway, to get packages like libc6-dev:armhf. > > Meson has tests that do cross compilation to armhf. What is the > correct way to set that up in official package builds?
The infrastructure that would be necessary to do that as a build-time test is not available (and perhaps never will be, because it would make the dependency graph a lot more complicated), so you will need to skip them at build-time. Official Debian buildds only have packages of their own architecture available. If you want better test coverage, you can run them as an autopkgtest (as-installed test) instead: see <https://salsa.debian.org/ci-team/autopkgtest/blob/master/doc/README.package-tests.rst>. In the case of Meson, an appropriate as-installed test would be to build one (or all) of the test/example projects from Meson's source tree, but using /usr/bin/meson instead of the meson script and mesonbuild library from the source package. > Calling add-architecture directly? You cannot do that when building the package, because at that point you don't have root privileges available. You *can* do that in an autopkgtest, if the test declares the needs-root restriction, which as far as I know is currently the only way to get cross-architecture packages installed. https://salsa.debian.org/debian/nss-mdns/blob/debian/master/debian/tests/multiarch-purge and https://salsa.debian.org/debian/nss-mdns/blob/debian/master/debian/tests/lib.sh are an example of an autopkgtest that makes use of cross-architecture packages. > The doc pages[1] talk about building cross > packages, but Meson does not do that, it builds a native package but > it also requires a cross toolchain (on every platform except armhf). More specifically, if I understand correctly, it doesn't require a cross toolchain to produce a correct meson package, but it does require a cross toolchain for full test coverage? smcv