diff mbox series

image, populate_sdk_base: warn on ';' in *_COMMAND function lists

Message ID 20261021120521.1453558-1-ecordonnier@snap.com
State Under Review
Headers show
Series image, populate_sdk_base: warn on ';' in *_COMMAND function lists | expand

Commit Message

Etienne Cordonnier Oct. 21, 2026, 12:05 p.m. UTC
From: Etienne Cordonnier <ecordonnier@snap.com>

Since c3365dfd9ddd ("classes: Drop ';' delimiter from ROOTFS/IMAGE*COMMAND
variables") these variables are space separated function lists, used as
vardeps of themselves. A stray ';' is still tolerated when the list is
executed, but at parse time "func;" names no variable, so the function is
not part of the do_rootfs/do_image/do_populate_sdk signature and a stale
rootfs or SDK can be reused from sstate.

Warn when a variable from rootfs_command_variables() or
sdk_command_variables() contains ';'. Tested by adding "foo;" entries and
checking the warning, and that stock core-image-minimal parses without it.

AI-Generated: Uses Claude Code (claude-sonnet-5-5)
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 meta/classes-recipe/image.bbclass             | 7 ++++++-
 meta/classes-recipe/populate_sdk_base.bbclass | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 460e5ab39f..1e3c784ec9 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -127,7 +127,12 @@  def rootfs_command_variables(d):
 python () {
     variables = rootfs_command_variables(d)
     for var in variables:
-        d.setVarFlag(var, 'vardeps', d.getVar(var))
+        value = d.getVar(var)
+        if value and ';' in value:
+            bb.warn("%s contains ';' but is a space separated list of functions, "
+                    "remove the ';' delimiters or the functions will not be part "
+                    "of the task signature: %s" % (var, value.strip()))
+        d.setVarFlag(var, 'vardeps', value)
 }
 
 def rootfs_variables(d):
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index 2c6dd1828c..0d67ab6ac6 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -423,7 +423,12 @@  do_populate_sdk[vardeps] += "${@sdk_variables(d)}"
 python () {
     variables = sdk_command_variables(d)
     for var in variables:
-        d.setVarFlag(var, 'vardeps', d.getVar(var))
+        value = d.getVar(var)
+        if value and ';' in value:
+            bb.warn("%s contains ';' but is a space separated list of functions, "
+                    "remove the ';' delimiters or the functions will not be part "
+                    "of the task signature: %s" % (var, value.strip()))
+        d.setVarFlag(var, 'vardeps', value)
 }
 
 do_populate_sdk[file-checksums] += "${TOOLCHAIN_SHAR_REL_TMPL}:True \