From: Quentin Schulz <quentin.schulz@cherry.de>
To: antonin.godard@bootlin.com, bitbake-devel@lists.openembedded.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
docs@lists.yoctoproject.org
Subject: Re: [docs] [PATCH] doc: extend classes and include/require documentation
Date: Wed, 3 Dec 2025 17:55:36 +0100 [thread overview]
Message-ID: <d8437f3b-effb-4aef-973d-0f01edece738@cherry.de> (raw)
In-Reply-To: <20250918-classes-order-v1-1-3b8b75e9cf10@bootlin.com>
Hi Antonin,
Just had the time to review this, sorry for the delay. I'll send a few
typo and rewording patches soon. However...
On 9/18/25 2:16 PM, Antonin Godard via lists.yoctoproject.org wrote:
[...]
> +Locating Include Files
> +----------------------
> +
> +BitBake uses the :term:`BBPATH` variable to locate needed include files.
> +Additionally, BitBake searches the current directory for :ref:`include
> +<ref-include-directive>` and :ref:`require <require-inclusion>` directives.
> +
> +.. note::
> +
> + The BBPATH variable is analogous to the environment variable PATH .
> +
> +For these two directives, BitBake includes the first file it finds.
> +
> +.. note::
> +
> + It is also possible to include *all* occurences of a file with the same name
> + with the :ref:`include_all <ref-include-all-directive>` directive.
> +
> +Let's consider the following statement called from a recipe file located in
> +``/layers/meta-custom2/recipes-example/example_0.1.bb``::
> +
> + require myfile.inc
> +
> +Where ``myfile.inc`` is located in ``/layers/meta-custom2/recipes-example/``.
> +
> +And let's assume that the value of :term:`BBPATH` is
> +``/layers/meta-custom1:/layers/meta-custom2``. Then BitBake will try to find
> +``myfile.inc`` in this order::
> +
> + /layers/meta-custom2/recipes-example/example/myfile.inc
> + /layers/meta-custom1/myfile.inc
> + /layers/meta-custom2/myfile.inc
> +
> +In this case the first path of the list matches and BitBake includes this file
> +in ``example_0.1.bb``.
> +
> +Another common example would be::
> +
> + require recipes-other/other/otherfile.inc
> +
> +Where ``otherfile.inc`` is located in
> +``/layers/meta-custom1/recipes-other/other/``.
> +
> +In this case, the following paths would be searched::
> +
> + /layers/meta-custom2/recipes-example/example/recipes-other/other/otherfile.inc
> + /layers/meta-custom1/recipes-other/other/otherfile.inc
> + /layers/meta-custom2/recipes-other/other/otherfile.inc
> +
I think we should provide an example for include_all directive as well?
After reading the code, I believe include_all does NOT search the local
path first, it only searches paths in BBPATH so I think it's worth
providing an example and maybe notes on how it differs from the other
directives.
What do you think?
Cheers,
Quentin
next prev parent reply other threads:[~2025-12-03 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 12:16 [PATCH] doc: extend classes and include/require documentation Antonin Godard
2025-12-03 16:55 ` Quentin Schulz [this message]
2025-12-04 13:16 ` [docs] " Antonin Godard
2026-01-12 16:38 ` Quentin Schulz
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=d8437f3b-effb-4aef-973d-0f01edece738@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=antonin.godard@bootlin.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=thomas.petazzoni@bootlin.com \
/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