]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
python3targetconfig: export _PYTHON_PROJECT_BASE
authorTrevor Gamblin <tgamblin@baylibre.com>
Tue, 13 Jan 2026 17:57:53 +0000 (12:57 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Jan 2026 17:46:18 +0000 (17:46 +0000)
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>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/python3targetconfig.bbclass

index 08bc619398f59c5160a2135e285e78b4a0dbc1d4..2877665737a9be9929386a509c4e1e064abdc02c 100644 (file)
@@ -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
 }