diff mbox series

[meta-lts-mixins,kirkstone/rust,1/2] python3-awscrt: fix unsafe include path error during cross-compilation

Message ID 20250618132937.4119240-1-soumya.sambu@windriver.com
State New
Headers show
Series [meta-lts-mixins,kirkstone/rust,1/2] python3-awscrt: fix unsafe include path error during cross-compilation | expand

Commit Message

ssambu June 18, 2025, 1:29 p.m. UTC
From: Soumya Sambu <soumya.sambu@windriver.com>

After meta-lts-mixins introduced a newer setuptools, python3-awscrt is failing
to build due to unsafe include path

cc1: error: include location "/usr/include/python3.10" is unsafe for cross-compilation [-Werror=poison-system-directories]

The issue is resolved by explicitly forcing setuptools to use distutils

Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
---
 conf/layer.conf                                                | 3 ++-
 .../iot-cloud/recipes-aws/python/python3-awscrt_%.bbappend     | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 dynamic-layers/iot-cloud/recipes-aws/python/python3-awscrt_%.bbappend

Comments

Scott Murray June 18, 2025, 3:36 p.m. UTC | #1
On Wed, 18 Jun 2025, Soumya via lists.yoctoproject.org wrote:

> From: Soumya Sambu <soumya.sambu@windriver.com>
>
> After meta-lts-mixins introduced a newer setuptools, python3-awscrt is failing
> to build due to unsafe include path
>
> cc1: error: include location "/usr/include/python3.10" is unsafe for cross-compilation [-Werror=poison-system-directories]
>
> The issue is resolved by explicitly forcing setuptools to use distutils

Can you elaborate a bit further, I can see that forcing the non-vendored
distutils (i.e. OE's copy) would have an effect, but if the default
setuptools behavior is broken with respect to leaking that include path,
I'd kind of expect wider spread breakage.  As well, things seem to be
working on scarthgap with python3-grpcio, and that's where the setuptools
backport is from...

Thanks,

Scott
diff mbox series

Patch

diff --git a/conf/layer.conf b/conf/layer.conf
index 4fe4ec4..280393d 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -28,7 +28,8 @@  BBMASK:append = " meta/recipes-devtools/python/python3-setuptools-rust-native_%"
 
 BBFILES_DYNAMIC += " \
     meta-python:${LAYERDIR}/dynamic-layers/meta-python/recipes-*/*/*.bbappend \
-    openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend"
+    openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend \
+    iot-cloud:${LAYERDIR}/dynamic-layers/iot-cloud/recipes-*/*/*.bbappend"
 
 # These are in bitbake.conf in langdale and up, adding them here to make
 # using the layer more turn-key seems reasonable.
diff --git a/dynamic-layers/iot-cloud/recipes-aws/python/python3-awscrt_%.bbappend b/dynamic-layers/iot-cloud/recipes-aws/python/python3-awscrt_%.bbappend
new file mode 100644
index 0000000..bd0b910
--- /dev/null
+++ b/dynamic-layers/iot-cloud/recipes-aws/python/python3-awscrt_%.bbappend
@@ -0,0 +1,3 @@ 
+do_compile:prepend() {
+    export SETUPTOOLS_USE_DISTUTILS=stdlib
+}