local Bash variables leak into bitbake signatures

6 views
Skip to first unread message

MOESSBAUER, Felix

unread,
Nov 26, 2024, 11:16:02 AM11/26/24
to isar-...@googlegroups.com, Schmidt, Adriaan, Kiszka, Jan
Hi,

while debugging the ca-certificates problem, I noticed that our SState
siginfo files contain a lot of garbage. This happens, as all variables
in a shell function that are at least once accessed using ${foo} syntax
(bitbake syntax) are added to the signatures (without a value). This is
problematic for the following reasons:

1. The variable names (esp. very short ones) can easily collide with a
bitbake task name. Then the content of the task is copy-pasted to the
location the variable is accessed.

2. Signature size. Probably not too relevant yet, but when manually
inspecting the signatures that's really annoying.

Despite in "normal" shell code, in bitbake it is NOT a good habit to
access shell variables with the curly brace pattern. IOW, this is
discouraged. I don't know why they still have the following statement
in their docs:

> If the variable expansion syntax is used on a variable that does not
> exist, the string is kept as is.

In my opinion we should fix this and enforce it with a rule in the to-
be-written ISAR linter.

I know, there are some cases where this pattern cannot be avoided, but
these could be replaced by a python generator (like
${@bash_var('foo')).

Best regards,
Felix Moessbauer
Siemens AG

--
Siemens AG, Technology
Linux Expert Center


Reply all
Reply to author
Forward
0 new messages