From cc9df77220f25704350d985e809b6544234635fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 9 Mar 2026 12:06:13 -0400 Subject: [PATCH] meson.build: require python 3.10, try python3.12 The commit created a problem on RHEL 9 where python 3.9 is the default, which doesn't support the match keyword used by the commit. Python 3.12 can be installed as another option, but then another problem shows up that RHEL 9 lacks recent enough python3-mako that works with 3.12 (or at least that's my understanding of the issue), so we don't know yet whether Mesa is even buildable on that. Fixes: f2bb6103 - "vulkan/cmd_queue: Rework copy codegen" Reviewed-by: Eric Engestrom --- docs/install.rst | 2 +- meson.build | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 892a1966240..a3f64e3f159 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -36,7 +36,7 @@ you're willing to maintain support for other compiler get in touch. Third party/extra tools. ^^^^^^^^^^^^^^^^^^^^^^^^ -- `Python `__ - Python 3.9 or newer is required. +- `Python `__ - Python 3.10 or newer is required. - Python package ``packaging`` is required on Python 3.12+: ``pip install packaging`` - `Python Mako module `__ - Python Mako diff --git a/meson.build b/meson.build index 43b1afd7ba9..6283d72d3b5 100644 --- a/meson.build +++ b/meson.build @@ -1032,8 +1032,23 @@ if get_option('allow-kcmp') \ pre_args += '-DALLOW_KCMP' endif -# On Windows, a venv has no versioned aliased to 'python'. -prog_python = find_program('python3', 'python', version : '>= 3.9') +# Find a python executable that meets our version requirement. +# - On Windows, a venv has no versioned aliased to 'python'. +# - On RHEL 9, python3 is 3.9, so we must use python3.12. +python_version_req = '>= 3.10' +python_exec_list = ['python3.16', 'python3.15', 'python3.14', 'python3.13', + 'python3.12', 'python3.11', 'python3.10', 'python3', 'python'] + +foreach p : python_exec_list + prog_python = find_program(p, required : false, version : python_version_req) + if prog_python.found() + break + endif +endforeach + +if not prog_python.found() + error('Python ' + python_version_req + ' not found') +endif has_mako = run_command( prog_python, '-c',