public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Quentin Schulz <quentin.schulz@cherry.de>,
	javier.tia@linaro.org,  bitbake-devel@lists.openembedded.org
Cc: docs@lists.yoctoproject.org,
	Mikko Rapeli <mikko.rapeli@linaro.org>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [docs] [bitbake-devel] [PATCH] doc: Mention `if [[ somecondition ]]` is not supported
Date: Tue, 25 Mar 2025 17:49:04 +0000	[thread overview]
Message-ID: <605de159f6b70b6750fa94cb5268511ff2ce84fd.camel@linuxfoundation.org> (raw)
In-Reply-To: <92482b25-bd0e-4a9d-82f5-1fd4fdf473cb@cherry.de>

On Tue, 2025-03-25 at 18:30 +0100, Quentin Schulz wrote:
> Hi Richard,
> 
> On 3/25/25 11:14 AM, Richard Purdie wrote:
> > On Tue, 2025-03-25 at 11:04 +0100, Quentin Schulz via lists.yoctoproject.org wrote:
> > > 
> > > 
> > > On 3/20/25 1:33 AM, Javier Tia via lists.openembedded.org wrote:
> > > > I keep forgetting using `if [[ somecondition ]]` is not supported.
> > > > 
> > > > Signed-off-by: Javier Tia <javier.tia@linaro.org>
> > > > ---
> > > >    doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 ++++
> > > >    1 file changed, 4 insertions(+)
> > > > 
> > > > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > > > index 415fbf6d6..5474e154f 100644
> > > > --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > > > +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > > > @@ -1381,6 +1381,10 @@ To make use of this technique, you need the following things in place:
> > > >       To call your modified version of the function as defined in your recipe,
> > > >       call it as ``do_foo``.
> > > >    
> > > > +   .. note::
> > > > +
> > > > +      Conditional expression using ``[[ somecondition ]]`` is not supported.
> > > > +
> > > 
> > > Do you know what the reason is for that limitation?
> > > 
> > > The example above this git context is not really implying `[[
> > > somecondition ]]` would be valid though.
> > > 
> > > If I remember correctly, the shell functions are run by /bin/sh
> > > interpreter, so it depends on which shell you have configured by default
> > > in your system. Is it possible this is due to you being used to develop
> > > with bash where this is possible and having your Yocto build run with a
> > > different shell (e.g. dash, which doesn't seem to support that? c.f.
> > > https://manned.org/dash.1)?
> > > 
> > > I think we should recommend people write POSIX-compliant shell functions
> > > and tasks rather no?
> > 
> > Bitbake parses the shell functions and our shell parser can't cope with
> > certain syntax unfortunately.
> > 
> 
> Ah, I see. This happens before the shell even runs the code. Do we 
> happen to have a list of things/syntax we cannot parse?

There are open bugs. I did recently run into backgrounding not working
in the pseudo reproducer so I just used a separate script. Not sure we
want to support background processes though.

> I think it therefore deserves a bigger place than a small note, maybe
> e.g. a sub(sub...)section of limitations?

Patches welcome!

Cheers,

Richard


  reply	other threads:[~2025-03-25 17:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20  0:33 [PATCH] doc: Mention `if [[ somecondition ]]` is not supported Javier Tia
2025-03-25 10:04 ` [bitbake-devel] " Quentin Schulz
2025-03-25 10:14   ` [docs] " Richard Purdie
2025-03-25 17:30     ` Quentin Schulz
2025-03-25 17:49       ` Richard Purdie [this message]
2025-03-27 13:44 ` Antonin Godard

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=605de159f6b70b6750fa94cb5268511ff2ce84fd.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=javier.tia@linaro.org \
    --cc=mikko.rapeli@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