public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] wic-img: use python3.9 in bookworm
@ 2022-04-20 13:02 Henning Schild
  2022-04-20 13:04 ` Henning Schild
  2022-04-20 14:09 ` Henning Schild
  0 siblings, 2 replies; 8+ messages in thread
From: Henning Schild @ 2022-04-20 13:02 UTC (permalink / raw)
  To: isar-users; +Cc: Florian Bezdeka, Henning Schild

The jump to python3.10 will mean "from collections import Mapping" has
to switch to "from collections.abc import Mapping". Our bitbake still
has the old version and will not work with python 3.10. We might some
day need to fork parts of bitbake to make it work with any python3
version. But for now we can still fall back to python3.9 and do not need
to fork bitbake.

bookworm switched to python 3.10 about a month ago, since then one can
not build bookworm wic images any longer.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/wic-img.bbclass          | 7 ++++++-
 meta/conf/distro/debian-bookworm.conf | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 7537a27b613e..5623945378eb 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -192,11 +192,16 @@ generate_wic_image() {
           mkdir -p /usr/bin/python3-native/
           if [ $(head -1 $(which bmaptool) | grep python3) ];then
             ln -fs /usr/bin/python3 /usr/bin/python3-native/python3
+            # python 3.10 is too new for our bitbake version
+            if [ "$( readlink /usr/bin/python3 )" = "python3.10" ]; then
+              ln -fs /usr/bin/python3.9 /usr/bin/python3-native/python3
+            fi
           else
             ln -fs /usr/bin/python2 /usr/bin/python3-native/python3
           fi
           export PATH="$BITBAKEDIR/bin:$PATH"
-          "$SCRIPTSDIR"/wic create "$WKS_FULL_PATH" \
+          /usr/bin/python3-native/python3 \
+            "$SCRIPTSDIR"/wic create "$WKS_FULL_PATH" \
             --vars "$STAGING_DIR/$MACHINE/imgdata/" \
             -o "/$WICTMP/${IMAGE_FULLNAME}.wic/" \
             --bmap \
diff --git a/meta/conf/distro/debian-bookworm.conf b/meta/conf/distro/debian-bookworm.conf
index 7e614bf2b5c3..c5b08e6aaa35 100644
--- a/meta/conf/distro/debian-bookworm.conf
+++ b/meta/conf/distro/debian-bookworm.conf
@@ -6,6 +6,8 @@ BASE_DISTRO_CODENAME = "bookworm"
 
 HOST_DISTRO ?= "debian-${BASE_DISTRO_CODENAME}"
 
+WIC_IMAGER_INSTALL += "python3.9-distutils"
+
 DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
 DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
 	amd64 arm64 armmp-lpae armmp cloud-amd64 cloud-arm64 itanium \
-- 
2.35.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-04-21  7:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 13:02 [PATCH] wic-img: use python3.9 in bookworm Henning Schild
2022-04-20 13:04 ` Henning Schild
2022-04-20 16:21   ` Baurzhan Ismagulov
2022-04-21  7:36     ` Henning Schild
2022-04-20 14:09 ` Henning Schild
2022-04-20 14:20   ` Bezdeka, Florian
2022-04-20 14:20   ` Moessbauer, Felix
2022-04-20 14:23   ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox