public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Cedric Hombourger' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Cedric Hombourger <cedric.hombourger@siemens.com>
Subject: [PATCH] customizations: defer IMAGE variable expansion in CUSTOMIZATION_VARS
Date: Thu,  6 Nov 2025 16:15:08 +0100	[thread overview]
Message-ID: <20251106151508.3872857-1-cedric.hombourger@siemens.com> (raw)

The previous logic for conditionally adding the IMAGE variable to
CUSTOMIZATION_VARS suffered from a Bitbake variable expansion
timing issue.

The original line `CUSTOMIZATION_VARS_IMAGE ?= "${IMAGE}"` would evaluate
the `${IMAGE}` variable too early in the parsing process. If `IMAGE` had
not yet been fully defined or resolved to its final value (e.g.,
`isar-image-base`), `CUSTOMIZATION_VARS_IMAGE` would incorrectly store
the literal string `"${IMAGE}"`.

Consequently, when `CUSTOMIZATION_VARS` was later appended using a
Python expression that retrieved `CUSTOMIZATION_VARS_IMAGE`, it would
receive this unexpanded literal string. This led to build failures and
errors such as:

  ERROR: ... Unable to get checksum for ... ${IMAGE} SRC_URI entry ...

Introduce a new Bitbake override, `:customization-for-images`, which
is conditionally activated when `CUSTOMIZATION_FOR_IMAGES` is set (to
preserve the initial semantic of 9a2919be). The `IMAGE` variable is
then appended to `CUSTOMIZATION_VARS` specifically within this override
context:

  `CUSTOMIZATION_VARS:append:customization-for-images = " ${IMAGE}"`

By associating the append operation with an override, the expansion is
deferred and ensures that `${IMAGE}` is properly resolved to its value
before being added to `CUSTOMIZATION_VARS`.

Fixes: 9a2919be
Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 meta/classes/customization-base.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/customization-base.bbclass b/meta/classes/customization-base.bbclass
index 82cad67e..7603460b 100644
--- a/meta/classes/customization-base.bbclass
+++ b/meta/classes/customization-base.bbclass
@@ -8,8 +8,8 @@ CUSTOMIZATIONS[doc] = "List of customization packages to be installed in images.
 
 CUSTOMIZATION_VARS ?= "${DISTRO} ${MACHINE}"
 CUSTOMIZATION_VARS[doc] = "List of variables that should be added to customization package names."
-CUSTOMIZATION_VARS_IMAGE ?= "${IMAGE}"
-CUSTOMIZATION_VARS:append = " ${@d.getVar('CUSTOMIZATION_VARS_IMAGE') if d.getVar('CUSTOMIZATION_FOR_IMAGES').strip() else ''}"
+OVERRIDES:append = "${@ ':customization-for-images' if (d.getVar('CUSTOMIZATION_FOR_IMAGES') or '').strip() else '' }"
+CUSTOMIZATION_VARS:append:customization-for-images = " ${IMAGE}"
 
 CUSTOMIZATION_VARS_PREFIXED ?= "${DISTRO}"
 CUSTOMIZATION_VARS_PREFIXED[doc] = "List of variables from CUSTOMIZATION_VARS that should be prefixed rather than suffixed to customization package names."
-- 
2.47.3

-- 
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/20251106151508.3872857-1-cedric.hombourger%40siemens.com.

                 reply	other threads:[~2025-11-06 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251106151508.3872857-1-cedric.hombourger@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@siemens.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