Skip to content

Commit eba9e7e

Browse files
lazkaeli-schwartz
authored andcommitted
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. (cherry picked from commit a51d5f3)
1 parent c108d5b commit eba9e7e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎mesonbuild/environment.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ def machine_info_can_run(machine_info: MachineInfo):
509509
if machine_info.system != detect_system():
510510
return False
511511
true_build_cpu_family = detect_cpu_family({})
512+
assert machine_info.cpu_family is not None, 'called on incomplete machine_info'
512513
return \
513514
(machine_info.cpu_family == true_build_cpu_family) or \
514515
((true_build_cpu_family == 'x86_64') and (machine_info.cpu_family == 'x86')) or \

0 commit comments

Comments
 (0)