All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <richard.purdie@linuxfoundation.org>,
	<bitbake-devel@lists.openembedded.org>
Subject: Re: [bitbake-devel] [PATCH 06/17] cooker: Change layer.conf handling to new approach
Date: Mon, 30 Nov 2026 17:20:22 +0100	[thread overview]
Message-ID: <DN8OKYCVK0DE.1EOMQLVAUZKDT@bootlin.com> (raw)
In-Reply-To: <20261130152847.3472849-6-richard.purdie@linuxfoundation.org>

Hi,

On Mon Nov 30, 2026 at 4:28 PM CET, Richard Purdie via bitbake-devel wrote:
[...]
> --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> @@ -922,48 +922,6 @@ overview of their function and contents.
>           You must set this variable in the external environment in order
>           for it to work.
>  
> -   :term:`BBFILE_COLLECTIONS`
> -      Lists the names of configured layers. These names are used to find
> -      the other ``BBFILE_*`` variables. Typically, each layer appends its
> -      name to this variable in its ``conf/layer.conf`` file.
> -
> -   :term:`BBFILE_PATTERN`
> -      Variable that expands to match files from
> -      :term:`BBFILES` in a particular layer. This
> -      variable is used in the ``conf/layer.conf`` file and must be suffixed
> -      with the name of the specific layer (e.g.
> -      ``BBFILE_PATTERN_emenlow``).
> -
> -   :term:`BBFILE_PRIORITY`
> -      Assigns the priority for recipe files in each layer.
> -
> -      This variable is used in the ``conf/layer.conf`` file and must be
> -      suffixed with a `_` followed by the name of the specific layer (e.g.
> -      ``BBFILE_PRIORITY_emenlow``). Colon as separator is not supported.
> -
> -      This variable is useful in situations where the same recipe appears
> -      in more than one layer. Setting this variable allows you to
> -      prioritize a layer against other layers that contain the same recipe
> -      --- effectively letting you control the precedence for the multiple
> -      layers. The precedence established through this variable stands
> -      regardless of a recipe's version (:term:`PV` variable).
> -      For example, a layer that has a recipe with a higher :term:`PV` value but
> -      for which the :term:`BBFILE_PRIORITY` is set to have a lower precedence
> -      still has a lower precedence.
> -
> -      A larger value for the :term:`BBFILE_PRIORITY` variable results in a
> -      higher precedence. For example, the value 6 has a higher precedence
> -      than the value 5. If not specified, the :term:`BBFILE_PRIORITY` variable
> -      is set based on layer dependencies (see the :term:`LAYERDEPENDS` variable
> -      for more information). The default priority, if unspecified for a
> -      layer with no dependencies, is the lowest defined priority + 1 (or 1
> -      if no priorities are defined).
> -
> -      .. tip::
> -
> -         You can use the command bitbake-layers show-layers to list all
> -         configured layers along with their priorities.
> -
>     :term:`BBFILES`
>        A space-separated list of recipe files BitBake uses to build
>        software.
> @@ -1198,6 +1156,9 @@ overview of their function and contents.
>        Allows you to use a configuration file to add to the list of
>        command-line target recipes you want to build.
>  
> +   :term:`BITBAKEDIR`
> +      BitBake sets this to location where bitbake is being run from.
> +
>     :term:`BITBAKE_UI`
>        Used to specify the UI module to use when running BitBake. Using this
>        variable is equivalent to using the ``-u`` command-line option.
> @@ -1375,12 +1336,13 @@ overview of their function and contents.
>        available outside of ``layer.conf`` and references are expanded
>        immediately when parsing of the file completes.
>  
> -   :term:`LAYERDIR_RE`
> +   :term:`LAYERDIR_<layername>`

We usually don't have terms with placeholder values. I'd suggest defining it
only as LAYERDIR:

:term:`LAYERDIR`
   This variable is automatically defined by :term:`BitBake` when parsing the
   layers: when :term:`BitBake` reads the :term:`BBLAYERS` variable, it sets
   a new ``LAYERDIR_<layer name>`` variable containing the absolute layer path
   for each layer in the list. The ``<layer name>`` value is determined from the
   layer's :term:`LAYERNAME`.

Note that I have a follow-up patch for the currently undocumented LAYER*
variables.

[...]
> +                    if var in initial:
> +                        orig = initial.getVar(var, False)
> +                        new = ld.getVar(var, False)
> +                        if orig == new:
> +                            continue
> +                        if not new.startswith(orig):
> +                            errors.append("Layer %s is overwriting variable %s, it should only append to it" % (layer, var))
> +                            continue
> +                        append = new.removeprefix(orig)
> +                    if var.startswith(layer_safevars):
> +                        pass
> +                    elif var.startswith(("BBLAYERS_LAYERINDEX_NAME", "BB_GLOBAL_PYMODULES")):
> +                        pass
> +                    else:
> +                        bb.warn("Variable %s is set by %s but it will be ignored" % (var, layer))


I'd suggest printing a more useful warning message, something along:

 bb.warn(f"Variable {var} is set in {layer}/conf/layer.conf and will be ignored. "
         "Only variables part of LAYER_PASSTHROUGH_VARS_PREFIXES are allowed "
         "to be set from the layer.conf file.")

Antonin

  reply	other threads:[~2026-11-30 16:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 15:28 [PATCH 01/17] uihelper: Fix exception when TaskStarted event handler breaks Richard Purdie
2026-11-30 15:28 ` [PATCH 02/17] cache: Add support for BB_CACHE_EXTRAVARS Richard Purdie
2026-11-30 15:28 ` [PATCH 03/17] runqueue: Add a RecipeCheckEvent Richard Purdie
2026-11-30 15:28 ` [PATCH 04/17] providers: Drop support for changing preference level based upon layer priority Richard Purdie
2026-11-30 15:28 ` [PATCH 05/17] cooker/cache/command/tinfoil: Drop bbfile_priority Richard Purdie
2026-11-30 15:28 ` [PATCH 06/17] cooker: Change layer.conf handling to new approach Richard Purdie
2026-11-30 16:20   ` Antonin Godard [this message]
2026-11-30 15:28 ` [PATCH 07/17] tests/cooker: Drop obsolete collections test Richard Purdie
2026-11-30 15:28 ` [PATCH 08/17] default-registry: Update for new layer names Richard Purdie
2026-11-30 15:28 ` [PATCH 09/17] utils: Switch to use layerdata in get_file_layer() Richard Purdie
2026-11-30 15:28 ` [PATCH 10/17] utils: Add bb.utils.have_layer() to simplify metadata layer checks Richard Purdie
2026-11-30 15:28 ` [PATCH 11/17] layerindexlib/cooker: Switch to Use layerdata data struture Richard Purdie
2026-11-30 15:28 ` [PATCH 12/17] bblayers: Switch to use layerdata and new format layers Richard Purdie
2026-11-30 15:28 ` [PATCH 13/17] tests/runqueue: Add a test for RecipeCheckEvent/BB_CACHE_EXTRAVARS Richard Purdie
2026-11-30 15:28 ` [PATCH 14/17] tests: Add tests for wildcard version comparisions Richard Purdie
2026-11-30 15:28 ` [PATCH 15/17] tests/layers: Add tests after layer changes Richard Purdie
2026-11-30 15:28 ` [PATCH 16/17] ast/cookerdata: Allow addfragments to be called more than once Richard Purdie
2026-11-30 15:28 ` [PATCH 17/17] tests/layers: Add fragments tests Richard Purdie

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=DN8OKYCVK0DE.1EOMQLVAUZKDT@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.