From 86f9fe4c9a825feb93ca4b2ecf701d0877120d06 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 2 Oct 2024 19:25:12 +0100 Subject: env2mfile: Automatically set exe_wrapper on Debian if possible Recent versions of the architecture-properties package provide a cross-exe-wrapper package containing ${DEB_HOST_GNU_TYPE}-cross-exe-wrapper, which is currently a wrapper around qemu-user but could use different emulators on each architecture if it becomes necessary in the future. Signed-off-by: Simon McVittie --- mesonbuild/scripts/env2mfile.py | 7 +++++++ unittests/internaltests.py | 1 + 2 files changed, 8 insertions(+) diff --git a/mesonbuild/scripts/env2mfile.py b/mesonbuild/scripts/env2mfile.py index 2a366fd19..7896954fa 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -243,6 +243,13 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf infos.binaries[tool] = locate_path("%s-%s" % (host_arch, tool)) except ValueError: pass # optional + for tool, exe in [ + ('exe_wrapper', 'cross-exe-wrapper'), + ]: + try: + infos.binaries[tool] = locate_path("%s-%s" % (host_arch, exe)) + except ValueError: + pass try: infos.binaries['cups-config'] = locate_path("cups-config") except ValueError: diff --git a/unittests/internaltests.py b/unittests/internaltests.py index 0cf706001..0116f7fde 100644 --- a/unittests/internaltests.py +++ b/unittests/internaltests.py @@ -1750,6 +1750,7 @@ class InternalTests(unittest.TestCase): 'cmake': ['/usr/bin/cmake'], 'pkg-config': [f'/usr/bin/{gnu_tuple}-pkg-config'], 'cups-config': ['/usr/bin/cups-config'], + 'exe_wrapper': [f'/usr/bin/{gnu_tuple}-cross-exe-wrapper'], 'g-ir-annotation-tool': [f'/usr/bin/{gnu_tuple}-g-ir-annotation-tool'], 'g-ir-compiler': [f'/usr/bin/{gnu_tuple}-g-ir-compiler'], 'g-ir-doc-tool': [f'/usr/bin/{gnu_tuple}-g-ir-doc-tool'], -- cgit v1.2.3