From dbbc7800c53cb0ca7a77a6d54c7150d60045b84d Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 18 Mar 2026 16:02:43 +0100 Subject: [PATCH] meson: move yaml lib check inside python check This avoids picking a version of python that doesn't have pyyaml installed. Part-of: --- meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index fa72987c37d..e412c48408b 100644 --- a/meson.build +++ b/meson.build @@ -1070,6 +1070,11 @@ if Version(mako.__version__) < Version("0.8.0"): continue endif + has_yaml = run_command(prog_python, '-c', 'import yaml', check: false) + if has_yaml.returncode() != 0 + continue + endif + break endforeach @@ -1083,11 +1088,6 @@ elif has_mako.returncode() == 2 error('One of Python (3.x) packaging or distutils module is required.') endif -has_yaml = run_command( - prog_python, '-c', - ''' -import yaml - ''', check: false) if has_yaml.returncode() != 0 error('Python (3.x) yaml module (PyYAML) required to build mesa.') endif