[PATCH] image: Fix construction of do_image_tools dependencies

3 views
Skip to first unread message

Jan Kiszka

unread,
Oct 16, 2025, 2:51:54 PM (2 days ago) Oct 16
to isar-users, Anton Mikanovich, Felix Moessbauer, Quirin Gylstorff, Schmidt, Adriaan
From: Jan Kiszka <jan.k...@siemens.com>

The attempt to translate IMAGER_BUILD_DEPS into do_image_tools[depends]
via an anonymous python functions failed because of an ordering issue
between the anonymous functions in image-tools-extension.bbclass and
image.bbclass. The latter was expanding IMAGER_BUILD_DEPS:<image-type>
after image-tools-extension translated this variable into
do_image_tools[depends]. Resolve this by using an inline function for
the latter step.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---

Too bad that none of the isar tests detected it, only isar-cip-core
after updating its isar revision far enough. Looks like we have no self-
built packages for IMAGER_BUILD_DEPS here.

meta/classes/image-tools-extension.bbclass | 8 +++-----
meta/classes/image.bbclass | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/meta/classes/image-tools-extension.bbclass b/meta/classes/image-tools-extension.bbclass
index 5e248f2e..3f284b39 100644
--- a/meta/classes/image-tools-extension.bbclass
+++ b/meta/classes/image-tools-extension.bbclass
@@ -1,5 +1,5 @@
# This software is a part of ISAR.
-# Copyright (C) Siemens AG, 2019-2024
+# Copyright (C) Siemens AG, 2019-2025
#
# SPDX-License-Identifier: MIT
#
@@ -10,10 +10,8 @@ inherit sbuild
IMAGER_INSTALL ??= ""
IMAGER_BUILD_DEPS ??= ""

-python() {
- for dep in d.getVar('IMAGER_BUILD_DEPS').split():
- d.appendVarFlag('do_image_tools', 'depends', ' ' + dep + ':do_deploy_deb')
-}
+do_image_tools[depends] += " \
+ ${@' '.join(dep + ':do_deploy_deb' for dep in d.getVar('IMAGER_BUILD_DEPS').split())}"

SCHROOT_MOUNTS = "${WORKDIR}:${PP_WORK} ${IMAGE_ROOTFS}:${PP_ROOTFS} ${DEPLOY_DIR_IMAGE}:${PP_DEPLOY}"
SCHROOT_MOUNTS += "${REPO_ISAR_DIR}/${DISTRO}:/isar-apt"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index bd1b8552..441ea936 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -373,7 +373,7 @@ python do_image_tools() {
addtask image_tools before do_build after do_rootfs

# all imagetypes are depend on schroot and isar-apt
-do_image_tools[depends] = "${SCHROOT_DEP} isar-apt:do_cache_config"
+do_image_tools[depends] += "${SCHROOT_DEP} isar-apt:do_cache_config"
do_image_tools[deptask] = "do_deploy_deb"

python do_image() {
--
2.51.0

Jan Kiszka

unread,
Oct 16, 2025, 2:56:03 PM (2 days ago) Oct 16
to isar-users, Anton Mikanovich, Felix Moessbauer, Quirin Gylstorff, Schmidt, Adriaan
On 16.10.25 20:51, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.k...@siemens.com>
>
> The attempt to translate IMAGER_BUILD_DEPS into do_image_tools[depends]
> via an anonymous python functions failed because of an ordering issue
> between the anonymous functions in image-tools-extension.bbclass and
> image.bbclass. The latter was expanding IMAGER_BUILD_DEPS:<image-type>
> after image-tools-extension translated this variable into
> do_image_tools[depends]. Resolve this by using an inline function for
> the latter step.
>

Fixes: 8cf87a800ec0 ("image-tools-extension: Limit IMAGER_BUILD_DEPS to do_image_tools task")

Sorry, forgotten.

Jan
Siemens AG, Foundational Technologies
Linux Expert Center

MOESSBAUER, Felix

unread,
Oct 17, 2025, 3:13:54 AM (yesterday) Oct 17
to ami...@ilbers.de, isar-...@googlegroups.com, Kiszka, Jan, Schmidt, Adriaan, quirin.g...@siemens.com
On Thu, 2025-10-16 at 20:51 +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.k...@siemens.com>
>
> The attempt to translate IMAGER_BUILD_DEPS into do_image_tools[depends]
> via an anonymous python functions failed because of an ordering issue
> between the anonymous functions in image-tools-extension.bbclass and
> image.bbclass. The latter was expanding IMAGER_BUILD_DEPS:<image-type>
> after image-tools-extension translated this variable into
> do_image_tools[depends]. Resolve this by using an inline function for
> the latter step.

Thanks! I successfully tested this on the previously broken isar-cip-
core.

Tested-by: Felix Moessbauer <felix.mo...@siemens.com>
--
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany

Reply all
Reply to author
Forward
0 new messages