| Message ID | 0f16240d-aca7-4f03-b0f7-1567c5b4c26f@siemens.com |
|---|---|
| State | Accepted, archived |
| Headers | show |
| Series | image: Fix construction of do_image_tools dependencies | expand |
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() {
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
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 >
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() {
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() {