public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>,
	Henning Schild <henning.schild@siemens.com>
Subject: [PATCH] wic-img: use python3.9 in bookworm
Date: Wed, 20 Apr 2022 15:02:21 +0200	[thread overview]
Message-ID: <20220420130221.23398-1-henning.schild@siemens.com> (raw)

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


             reply	other threads:[~2022-04-20 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 13:02 Henning Schild [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420130221.23398-1-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox