I noticed that under meson, the selection of the Python installation
using the 'PYTHON' option doesn't work completely. The 'PYTHON' option
determined the Python binary that will be used to call the various build
support programs. But it doesn't affect the Python installation used
for PL/Python. For that, we need to pass the program determined by the
'PYTHON' option back into the find_installation() routine of the python
module. (Otherwise, find_installation() will just search for an
installation on its own.) See attached patch. I ran this through
Cirrus, seems to work.From d83c43c1bed2a096549fada42951b346b269c551 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Tue, 28 Nov 2023 18:56:18 +0100
Subject: [PATCH] Meson python detection
When we look for the Python installation using the meson python
module, we should make it use the python program previously determined
by the 'PYTHON' option. Otherwise, it will just use its own search
and the 'PYTHON' option won't affect it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index ee58ee7a06..24fddc677b 100644
--- a/meson.build
+++ b/meson.build
@@ -1063,7 +1063,7 @@ pyopt = get_option('plpython')
python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt)
+ python3_inst = pm.find_installation(python.path(), required: pyopt)
if python3_inst.found()
python3_dep = python3_inst.dependency(embed: true, required: pyopt)
# Remove this check after we depend on Meson >= 1.1.0
--
2.43.0