From 65f6eac60d67c8b66a2de98758f5dd5d3bd64844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20P=C3=B6tzsch?= Date: Thu, 8 Oct 2026 13:48:37 +0200 Subject: [PATCH] python3: use the own headers for C extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sysconfig data of the host tool points to /usr/include for the Python headers. Outside of a sandbox these are the headers of the host Python, which do not match and may not even be usable with the host compat toolchain. Point INCLUDEPY and CONFINCLUDEPY to the headers of the tool. Signed-off-by: Christian Pötzsch --- recipes/python/python3.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/python/python3.yaml b/recipes/python/python3.yaml index 2d56da99..542c80a8 100644 --- a/recipes/python/python3.yaml +++ b/recipes/python/python3.yaml @@ -91,6 +91,12 @@ multiPackage: autotoolsPackageDev autotoolsPackageTgt ln -sf python3 usr/bin/python + # Build C extensions with the headers of this python, not + # with the ones of the python of the host + sed -i -E \ + -e '1i prefix = "/".join(__file__.split("/")[:-3])' \ + -e "s|^( *'(CONF)?INCLUDEPY': )'/usr|\\1prefix + '|" \ + usr/lib/python${PKG_VERSION%\.*}/_sysconfigdata_*.py provideTools: python3: usr/bin