From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <foss@0leil.net>, <bitbake-devel@lists.openembedded.org>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>,
<docs@lists.yoctoproject.org>,
"Quentin Schulz" <quentin.schulz@cherry.de>
Subject: Re: [docs] [PATCH 3/4] doc: bitbake-user-manual-ref-variables: clarify BBMASK matching patterns
Date: Thu, 12 Feb 2026 09:58:39 +0100 [thread overview]
Message-ID: <DGCUY7U4ZJZE.1Y4VMQEELJUO@bootlin.com> (raw)
In-Reply-To: <20260211-bbmask-slashes-v1-3-b72161c647ef@cherry.de>
Hi,
On Wed Feb 11, 2026 at 7:06 PM CET, Quentin Schulz via lists.yoctoproject.org wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> The documentation doesn't explain the side-effect of putting a leading
> slash, only the trailing slash.
>
> The leading slash is not for making the regular expression match an
> absolute path, but to force the match on the directory or file that
> exactly starts (and ends if there is a trailing slash) with the
> specified string.
>
> Finally, this also explains that this still doesn't prevent more than
> the intended path to be caught up, specifically because it is NOT a
> regular expression matching an absolute path. For that though, the user
> can use BBFILE_PATTERN set for the layer they want to mask the recipe or
> append files to BitBake. This is typically a regex starting with
> ^${LAYERDIR}, making it an absolute path matching.
>
> Let's document those limitations.
>
> Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
> .../bitbake-user-manual-ref-variables.rst | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> index f20a9012c..6612dcc03 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> @@ -1071,6 +1071,28 @@ overview of their function and contents.
> When specifying a directory name, use the trailing slash character
> to ensure you match just that directory name.
>
> + .. note::
> +
> + The leading slash in a regular expression in :term:`BBMASK` does not
> + mean the path is absolute. It simply forces the directory to be named
> + exactly that. Take::
> +
> + BBMASK = "meta-ti/recipes-bsp/"
> +
> + If you happen to have a directory ``my-meta-ti/recipes-bsp``, it will
> + be matched.
> +
> + Leading with a slash::
> +
> + BBMASK = "/meta-ti/recipes-bsp/"
> +
> + makes sure that doesn't happen. However, this doesn't prevent matching a
> + directory ``meta-foo/meta-ti/recipes-bsp``. For that, use the
> + appropriate :term:`BBFILE_PATTERN` to only match a directory from one
> + specific layer::
> +
> + BBMASK = "${BBFILE_PATTERN_meta-ti}/recipes-bsp/"
So this looks this is actually what most users want to do, right? Wouldn't it be
better to put this forward instead of in a note, say, at the beginning of the
definition?
For example, replacing the first example in the variable's definition by:
-The following example uses a complete regular expression to tell
-BitBake to ignore all recipe and recipe append files in the
-``meta-ti/recipes-misc/`` directory::
-
- BBMASK = "meta-ti/recipes-misc/"
+The following example uses a complete regular expression to tell BitBake to
+ignore all recipe and recipe append files in the ``recipes-misc/`` directory
+and subdirectories of the ``meta-ti`` layer::
+
+ BBMASK = "${BBFILE_PATTERN_meta-ti}/recipes-bsp/"
What do you think?
Antonin
next prev parent reply other threads:[~2026-02-12 8:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 18:06 [PATCH 0/4] doc: bitbake-user-manual-ref-variables: clarify BBMASK examples Quentin Schulz
2026-02-11 18:06 ` [PATCH 1/4] doc: bitbake-user-manual-ref-variables: clarify BBMASK directory matching Quentin Schulz
2026-02-12 8:49 ` [docs] " Antonin Godard
2026-02-12 11:12 ` Quentin Schulz
2026-02-11 18:06 ` [PATCH 2/4] doc: bitbake-user-manual-ref-variables: have directory examples be consistent Quentin Schulz
2026-02-11 18:06 ` [PATCH 3/4] doc: bitbake-user-manual-ref-variables: clarify BBMASK matching patterns Quentin Schulz
2026-02-12 8:58 ` Antonin Godard [this message]
2026-02-12 11:38 ` [docs] " Quentin Schulz
2026-02-16 8:02 ` Antonin Godard
2026-02-11 18:06 ` [PATCH 4/4] doc: bitbake-user-manual-ref-variables: update BBMASK example with current meta-ti Quentin Schulz
2026-02-11 20:45 ` [docs] [PATCH 0/4] doc: bitbake-user-manual-ref-variables: clarify BBMASK examples Robert P. J. Day
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=DGCUY7U4ZJZE.1Y4VMQEELJUO@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=foss@0leil.net \
--cc=quentin.schulz@cherry.de \
--cc=rpjday@crashcourse.ca \
/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