From: Simon McVittie Date: Tue, 1 Oct 2024 13:28:56 +0000 (+0100) Subject: CI: Only configure wine as an exe_wrapper if we are going to run tests X-Git-Tag: dbus-1.15.12~18^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d5e78798d3a2fceee869c187b072373a5b0383c;p=thirdparty%2Fdbus.git CI: Only configure wine as an exe_wrapper if we are going to run tests This choice of exe_wrapper doesn't appear to work on Debian 12, causing a build failure while checking that the output of the C++ compiler is executable. Another advantage of this is that if we're not running the test suite, we can do a more traditional cross-build where running host-architecture executables is impossible, which doubles as a way to prove that this still works. Signed-off-by: Simon McVittie --- diff --git a/maint/i686-w64-mingw32.txt b/maint/i686-w64-mingw32.txt index dd92c458b..2c2f94972 100644 --- a/maint/i686-w64-mingw32.txt +++ b/maint/i686-w64-mingw32.txt @@ -9,7 +9,6 @@ ar = '/usr/bin/i686-w64-mingw32-ar' strip = '/usr/bin/i686-w64-mingw32-strip' pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config' windres = '/usr/bin/i686-w64-mingw32-windres' -exe_wrapper = ['xvfb-run', '-a', 'wine'] ld = '/usr/bin/i686-w64-mingw32-ld' cmake = '/usr/bin/cmake' diff --git a/maint/wine-exe-wrapper.txt b/maint/wine-exe-wrapper.txt new file mode 100644 index 000000000..c593e2e07 --- /dev/null +++ b/maint/wine-exe-wrapper.txt @@ -0,0 +1,6 @@ +# Copyright 2018-2020 Meson contributors +# Copyright 2024 Collabora Ltd. +# SPDX-License-Identifier: Apache-2.0 + +[binaries] +exe_wrapper = ['xvfb-run', '-a', 'wine'] diff --git a/maint/x86_64-w64-mingw32.txt b/maint/x86_64-w64-mingw32.txt index 80c3607ad..b98a2e497 100644 --- a/maint/x86_64-w64-mingw32.txt +++ b/maint/x86_64-w64-mingw32.txt @@ -9,7 +9,6 @@ ar = '/usr/bin/x86_64-w64-mingw32-ar' strip = '/usr/bin/x86_64-w64-mingw32-strip' pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config' windres = '/usr/bin/x86_64-w64-mingw32-windres' -exe_wrapper = ['xvfb-run', '-a', 'wine'] ld = '/usr/bin/x86_64-w64-mingw32-ld' cmake = '/usr/bin/cmake' diff --git a/tools/ci-build.sh b/tools/ci-build.sh index ea6b35a26..c971415cd 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -291,7 +291,7 @@ case "$ci_buildsys" in export DBUS_TEST_MALLOC_FAILURES=0 meson_setup= - cross_file= + cross_files=() # openSUSE has convenience wrappers that run Meson with appropriate # cross options @@ -306,7 +306,12 @@ case "$ci_buildsys" in case "$ci_host" in (*-w64-mingw32) - cross_file="${srcdir}/maint/${ci_host}.txt" + cross_files=("${cross_files[@]}" "${srcdir}/maint/${ci_host}.txt") + + if [ "$ci_test" = yes ]; then + cross_files=("${cross_files[@]}" "${srcdir}/maint/wine-exe-wrapper.txt") + fi + # openSUSE's wrappers are designed for building predictable # RPM packages, so they set --auto-features=enabled - # but that includes some things that make no sense on @@ -432,9 +437,9 @@ case "$ci_buildsys" in if [ -z "$meson_setup" ] || ! command -v "$meson_setup" >/dev/null; then meson_setup="meson setup" - if [ -n "$cross_file" ]; then + for cross_file in "${cross_files[@]}"; do set -- --cross-file="$cross_file" "$@" - fi + done fi # We assume this when we set LD_LIBRARY_PATH for as-installed