public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] image: Fix construction of do_image_tools dependencies
@ 2025-10-16 18:51 'Jan Kiszka' via isar-users
  2025-10-16 18:55 ` 'Jan Kiszka' via isar-users
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-10-16 18:51 UTC (permalink / raw)
  To: isar-users, Anton Mikanovich
  Cc: Felix Moessbauer, Quirin Gylstorff, Schmidt, Adriaan

From: Jan Kiszka <jan.kiszka@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.kiszka@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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/0f16240d-aca7-4f03-b0f7-1567c5b4c26f%40siemens.com.

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

end of thread, other threads:[~2025-10-23  7:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-16 18:51 [PATCH] image: Fix construction of do_image_tools dependencies 'Jan Kiszka' via isar-users
2025-10-16 18:55 ` 'Jan Kiszka' via isar-users
2025-10-17  7:13 ` 'MOESSBAUER, Felix' via isar-users
2025-10-19 12:06 ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-23  7:58 ` Zhihang Wei

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