diff mbox series

[2/5,v2] python3targetconfig: export _PYTHON_PROJECT_BASE

Message ID 20251219134734.842422-3-tgamblin@baylibre.com
State New
Headers show
Series python3: upgrade 3.13.9 -> 3.14.2 | expand

Commit Message

Trevor Gamblin Dec. 19, 2025, 1:47 p.m. UTC
See: https://github.com/python/cpython/commit/2950bc50af8f

As of 3.14.0, Python's sysconfig module looks for _PYTHON_PROJECT_BASE
to be set when cross-compiling, or otherwise it'll find and use the
native interpreter's paths when calling get_path() and filling out
_CONFIG_VARS. Set _PYTHON_PROJECT_BASE to "${B}" in
python3targetconfig's setup_target_config() to help avoid issues with
incorrect paths in rpm and other recipes that depend on this class.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 meta/classes-recipe/python3targetconfig.bbclass | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/python3targetconfig.bbclass b/meta/classes-recipe/python3targetconfig.bbclass
index 08bc619398..2877665737 100644
--- a/meta/classes-recipe/python3targetconfig.bbclass
+++ b/meta/classes-recipe/python3targetconfig.bbclass
@@ -12,6 +12,7 @@  DEPENDS:append = " ${EXTRA_PYTHON_DEPENDS}"
 
 setup_target_config() {
         export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+        export _PYTHON_PROJECT_BASE="${B}"
         export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata:$PYTHONPATH
         export PATH=${STAGING_EXECPREFIXDIR}/python-target-config/:$PATH
 }