Make sure machine_info_can_run() isn't called on incomplete MachineInfo

If need_exe_wrapper() is called while figuring out the language compiler,
the MachineInfo isn't complete yet, so machine_info_can_run() would return
False despite not cross compiling.

Make sure this fails loudly.
pull/13436/head
Christoph Reiter 5 months ago committed by Eli Schwartz
parent 76bd5548ae
commit a51d5f36da
  1. 1
      mesonbuild/environment.py

@ -510,6 +510,7 @@ def machine_info_can_run(machine_info: MachineInfo):
if machine_info.system != detect_system():
return False
true_build_cpu_family = detect_cpu_family({})
assert machine_info.cpu_family is not None, 'called on incomplete machine_info'
return \
(machine_info.cpu_family == true_build_cpu_family) or \
((true_build_cpu_family == 'x86_64') and (machine_info.cpu_family == 'x86')) or \

Loading…
Cancel
Save