From: Quentin Schulz <foss+yocto@0leil.net>
To: bitbake-devel@lists.openembedded.org
Cc: docs@lists.yoctoproject.org,
Quentin Schulz <quentin.schulz@cherry.de>,
Javier Tia <javier.tia@linaro.org>
Subject: [PATCH v2 2/2] doc: bitbake-user-manual-metadata: list known limitations for shell tasks
Date: Fri, 27 Feb 2026 12:30:16 +0100 [thread overview]
Message-ID: <20260227-shell-invalid-v2-2-df5cec5718bd@cherry.de> (raw)
In-Reply-To: <20260227-shell-invalid-v2-0-df5cec5718bd@cherry.de>
From: Quentin Schulz <quentin.schulz@cherry.de>
Javier Tia reported[1] they keep forgetting `[[` conditional isn't
supported and scouring our BugZilla, I found[2] another "bug" where
arithmetic expansion isn't supported either.
Let's add a subsection of the shell tasks with the known limitations.
[1] https://lore.kernel.org/bitbake-devel/20250320003358.977774-1-javier.tia@linaro.org/
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11314
Reported-by: Javier Tia <javier.tia@linaro.org>
Suggested-by: Javier Tia <javier.tia@linaro.org>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
.../bitbake-user-manual-metadata.rst | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 1b7941335..1ae94ccd6 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -1231,7 +1231,9 @@ When you create these types of functions in
your recipe or class files, you need to follow the shell programming
rules. The scripts are executed by ``/bin/sh``, which may not be a bash
shell but might be something such as ``dash``. You should not use
-Bash-specific script (bashisms).
+Bash-specific script (bashisms), such as ``[[`` (use ``[`` instead). The BitBake
+shell parser also has further
+:ref:`limitations <bitbake-user-manual/bitbake-user-manual-metadata:limitations>`.
Overrides and override-style operators like ``:append`` and ``:prepend``
can also be applied to shell functions. Most commonly, this application
@@ -1272,6 +1274,20 @@ Running ``do_foo`` prints the following::
You can use the ``bitbake -e recipename`` command to view the final
assembled function after all overrides have been applied.
+Limitations
+^^^^^^^^^^^
+
+Shell functions must be parsable by BitBake, which cannot handle all
+syntax supported by POSIX shells. In particular:
+
+#. Arithmetic expansion is not supported. This means you cannot do:
+
+ .. code-block:: shell
+
+ VAR=$(( i + 1 ))
+
+ See https://bugzilla.yoctoproject.org/show_bug.cgi?id=11314.
+
BitBake-Style Python Functions
------------------------------
--
2.53.0
prev parent reply other threads:[~2026-02-27 11:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 11:30 [PATCH v2 0/2] doc: bitbake-user-manual-metadata: list known limitations for shell task Quentin Schulz
2026-02-27 11:30 ` [PATCH v2 1/2] doc: bitbake-user-manual-metadata: promote inherit_defer directive to subsection Quentin Schulz
2026-02-27 11:30 ` Quentin Schulz [this message]
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=20260227-shell-invalid-v2-2-df5cec5718bd@cherry.de \
--to=foss+yocto@0leil.net \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=javier.tia@linaro.org \
--cc=quentin.schulz@cherry.de \
/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