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

* Re: [PATCH] image: Fix construction of do_image_tools dependencies
  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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-10-16 18:55 UTC (permalink / raw)
  To: isar-users, Anton Mikanovich
  Cc: Felix Moessbauer, Quirin Gylstorff, Schmidt, Adriaan

On 16.10.25 20:51, 'Jan Kiszka' via isar-users wrote:
> 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.
> 

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

Sorry, forgotten.

Jan

> 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() {
-- 
Siemens AG, Foundational Technologies
Linux Expert Center

-- 
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/50817b6b-562b-4bc9-b047-2af3ad6f4075%40siemens.com.

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

* Re: [PATCH] image: Fix construction of do_image_tools dependencies
  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
  3 siblings, 0 replies; 5+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2025-10-17  7:13 UTC (permalink / raw)
  To: amikan, isar-users, Kiszka, Jan; +Cc: Schmidt, Adriaan, quirin.gylstorff

On Thu, 2025-10-16 at 20:51 +0200, Jan Kiszka wrote:
> 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.

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

Tested-by: Felix Moessbauer <felix.moessbauer@siemens.com>

> 
> 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

-- 
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany

-- 
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/6e6285a4111f314b2bcdf4db71c3bb4cd3464a3d.camel%40siemens.com.

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

* Re: [PATCH] image: Fix construction of do_image_tools dependencies
  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
  3 siblings, 0 replies; 5+ messages in thread
From: 'cedric.hombourger@siemens.com' via isar-users @ 2025-10-19 12:06 UTC (permalink / raw)
  To: amikan, isar-users, Kiszka, Jan
  Cc: Schmidt, Adriaan, quirin.gylstorff, MOESSBAUER, Felix

On Thu, 2025-10-16 at 20:51 +0200, 'Jan Kiszka' via isar-users wrote:
> 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.

should we use this patch to correct the situation and add a test-case
which would ideally fail without your patch and succeed when applied.

> 
>  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
> 

-- 
Cedric Hombourger
Siemens AG
www.siemens.com

-- 
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/f8b514dc11b62fa8b63ab09c4954add658286f5b.camel%40siemens.com.

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

* Re: [PATCH] image: Fix construction of do_image_tools dependencies
  2025-10-16 18:51 [PATCH] image: Fix construction of do_image_tools dependencies 'Jan Kiszka' via isar-users
                   ` (2 preceding siblings ...)
  2025-10-19 12:06 ` 'cedric.hombourger@siemens.com' via isar-users
@ 2025-10-23  7:58 ` Zhihang Wei
  3 siblings, 0 replies; 5+ messages in thread
From: Zhihang Wei @ 2025-10-23  7:58 UTC (permalink / raw)
  To: Jan Kiszka, isar-users, Anton Mikanovich
  Cc: Felix Moessbauer, Quirin Gylstorff, Schmidt, Adriaan

Applied to next, thanks.

Best regards,
Zhihang

On 10/16/25 20:51, 'Jan Kiszka' via isar-users wrote:
> 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() {

-- 
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/bbbe0806-40cb-44e7-8c65-223f33ba11dd%40ilbers.de.

^ 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