diff options
| author | Christoph Reiter <reiter.christoph@gmail.com> | 2024-07-12 07:17:12 +0200 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-07-16 02:01:21 -0400 |
| commit | a51d5f36da85c1652c20254a522a9448147c4fbf (patch) | |
| tree | db8aa2f10e9d087932e69e72dd8a5de6f7543b7e /mesonbuild/environment.py | |
| parent | 76bd5548ae185e10a6cf3925980e8a18955e5c66 (diff) | |
| download | meson-a51d5f36da85c1652c20254a522a9448147c4fbf.tar.gz | |
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.
Diffstat (limited to 'mesonbuild/environment.py')
| -rw-r--r-- | mesonbuild/environment.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 640c1b892..de4dec8fe 100644 --- a/mesonbuild/environment.py +++ b/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 \ |
