From af846a109f70b0b063b9d3c7a30225a22949bb48 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Mon, 4 Apr 2022 18:35:49 -0500 Subject: [PATCH] Detect Cython and Vala compilers on the build machine always Transpilers need to run on the build machine in order to generate their output, which can then be taken by a cross-compiler to create the final output. --- mesonbuild/compilers/detect.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 5e147a848..a503535c7 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -14,7 +14,7 @@ from __future__ import annotations from ..mesonlib import ( - MesonException, EnvironmentException, + MesonException, EnvironmentException, MachineChoice, search_version, is_windows, Popen_safe, windows_proof_rm, ) from ..envconfig import BinaryTable @@ -149,7 +149,6 @@ if T.TYPE_CHECKING: from .objcpp import ObjCPPCompiler from ..linkers import StaticLinker from ..environment import Environment - from ..mesonlib import MachineChoice from ..programs import ExternalProgram @@ -941,7 +940,7 @@ def detect_cs_compiler(env: 'Environment', for_machine: MachineChoice) -> Compil def detect_cython_compiler(env: 'Environment', for_machine: MachineChoice) -> Compiler: """Search for a cython compiler.""" - compilers, _, _ = _get_compilers(env, 'cython', for_machine) + compilers, _, _ = _get_compilers(env, 'cython', MachineChoice.BUILD) is_cross = env.is_cross_build(for_machine) info = env.machines[for_machine] @@ -962,7 +961,7 @@ def detect_cython_compiler(env: 'Environment', for_machine: MachineChoice) -> Co raise EnvironmentException('Unreachable code (exception to make mypy happy)') def detect_vala_compiler(env: 'Environment', for_machine: MachineChoice) -> Compiler: - exelist = env.lookup_binary_entry(for_machine, 'vala') + exelist = env.lookup_binary_entry(MachineChoice.BUILD, 'vala') is_cross = env.is_cross_build(for_machine) info = env.machines[for_machine] if exelist is None: