From 8db2d786113eaa31b675f03c51f40974463ef77e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 2 Oct 2024 19:27:00 +0100 Subject: [PATCH] env2mfile: Use a cross valac on Debian if possible This is functionally equivalent to the logic used to locate the cross exe_wrapper, but puts it below the "Compilers" heading rather than "Other binaries". 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 9f58a900b617..43e816bad23d 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -249,6 +249,13 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf infos.binaries[tool] = locate_path("%s-%s" % (host_arch, exe)) except ValueError: pass + for tool, exe in [ + ('vala', 'valac'), + ]: + try: + infos.compilers[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 de13f533d9df..6e89f1b01283 100644 --- a/unittests/internaltests.py +++ b/unittests/internaltests.py @@ -1739,6 +1739,7 @@ def expected_compilers( 'cpp': [f'/usr/bin/{gnu_tuple}-g++{gcc_suffix}'], 'objc': [f'/usr/bin/{gnu_tuple}-gobjc{gcc_suffix}'], 'objcpp': [f'/usr/bin/{gnu_tuple}-gobjc++{gcc_suffix}'], + 'vala': [f'/usr/bin/{gnu_tuple}-valac'], } def expected_binaries(gnu_tuple: str) -> T.Dict[str, T.List[str]]: