From patchwork Wed Dec 2 14:25:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 106989 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.36795.1796221534832092554 for ; Wed, 02 Dec 2026 06:25:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=vNHFveB5; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 6B2264E41845; Wed, 2 Dec 2026 14:25:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 40C4C6075F; Wed, 2 Dec 2026 14:25:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7089611EA1B50; Wed, 02 Dec 2026 15:25:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796221532; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=H9NYqlEwkvsZzztIFoNAegWB0rKr9VSc7sLb8fsQBv4=; b=vNHFveB5avUao9Ydpe/9nYHOG6Nu3ie0yhgdwywyuoNSs1rLYNg+c1CiwwkYQa5Zbta337 YwI4ovkVrAU5f7XUml1YwZguWG0AEs3sVMkSX4b1eqnQTh03pAoIdHuyLkYkCSsgT62d7J jyIDxLdNho/VHNBR0g8ET/+jbXI3Z8vUl+KO0eUix/4T5skpOiMc5lut/VeqHpUlw+F60O jjSz8ciQ2LgwN0qdSHGLYGpohBh/ghVWlWD3CB5MjDiaAqcpYj8aGXqRJVtIkHaZEA3mZV Oalxt45nH9/UgfoAREl0+lZI1HJ0XOWMgD0Ts2nYzZ6ClWX8t53RWqSP0ohxSA== From: Antonin Godard Date: Wed, 02 Dec 2026 15:25:12 +0100 Subject: [PATCH 9/9] doc/bitbake-user-manual-execution: add a Parsing Order and Priorities section MIME-Version: 1.0 Message-Id: <20261202-layer-conf-doc-changes-v1-9-266a5f5d51ad@bootlin.com> References: <20261202-layer-conf-doc-changes-v1-0-266a5f5d51ad@bootlin.com> In-Reply-To: <20261202-layer-conf-doc-changes-v1-0-266a5f5d51ad@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=35190; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=ebiONvwGlqkniPsPg3ixTrpOeyxtqX2LGpxOLAolFmE=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrECpLFfPn9ME72zFVc6GcmUIhSbzsqSNKVq5al bOM6rHO/Y+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCaxAqSwAKCRDRgEFAKaOo NvugEACcfaqY0dO/qc+BBraCOfBzWfo/LuAHqReY1IAttDKpEjwUhEC/eZfRh/aXLwIM51eNnDE wrG2gGIcTMQ3aZ+cyVDjd1TuP1OHU+nRoeOKMpGIfiwMGCi7HazpC50KBn8RcYgOs5oEEvgjjnN TvhhxoIvuySX7lOoOjVgbDrnQeI8/iltY0CXV43r8qH/Slb1F+4rKw029gzG/RprF1Z1wRUEx23 5e2sC2Ef+vEZks9yoK5JxXGbs3uix4gmrH9Xz4KA3+K7cAFOL/4018iqI46feDpdXqs27lQc9+/ jHNpl5r7IHIvyx0Ouqq7F24dzSlO74BpcKVTVuuk/BnuCI9luW54F610fdz6YnX8IXzt22OGGVI C/FBP3+AL6Qr0HTjKLqFqLzLB+7w7W85mY5i/qZZfQiUIPGmRH/K7ses73l3yunA+LrrpakzmYR mOSO1K6up9pEYAHoT+Hl7y/A/vKnAIvS1Cj3EZihultRhdSrfDw6R7nqOcDE+MOeTDODhpFc2VT Kj5sohzMzX6v/Fxa4oxyYL7Q0qiykcfuscpuVld3n1a0wbLb/sCVe+DAKR19A6QukL6P7vJodOK RbUtmtKn9ZZhTZROHOzEryDjNyamYVqj/sMJcx2rs2Ibo/nbeivGFyfKo4AHQylRh2d901nGyGW VS833nAco75ONjA== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 14:25:39 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10886 Add a section explaining how metadata is prioritized after the layer configuration format changes. There is no concept of BBFILE_PRIORITY anymore, instead the priority is automatically determined based on dependencies. Signed-off-by: Antonin Godard --- .../bitbake-user-manual-execution.rst | 63 ++++++++++++++++++++++ .../svg/layer-dependencies-1.mmd | 14 +++++ .../svg/layer-dependencies-1.svg | 1 + .../svg/layer-dependencies-2.mmd | 15 ++++++ .../svg/layer-dependencies-2.svg | 1 + 5 files changed, 94 insertions(+) hick{stroke-width:3.5px;}#my-svg .edge-pattern-solid{stroke-dasharray:0;}#my-svg .edge-thickness-invisible{stroke-width:0;fill:none;}#my-svg .edge-pattern-dashed{stroke-dasharray:3;}#my-svg .edge-pattern-dotted{stroke-dasharray:2;}#my-svg .marker{fill:#0b0b0b;stroke:#0b0b0b;}#my-svg .marker.cross{stroke:#0b0b0b;}#my-svg svg{font-family:"Nimbus Sans",Helvetica,Arial,sans-serif;font-size:16px;}#my-svg p{margin:0;}#my-svg .label{font-family:"Nimbus Sans",Helvetica,Arial,sans-serif;color:#333;}#my-svg .cluster-label text{fill:rgb(8.5000000002, 5.7500000001, 0);}#my-svg .cluster-label span{color:rgb(8.5000000002, 5.7500000001, 0);}#my-svg .cluster-label span p{background-color:transparent;}#my-svg .label text,#my-svg span{fill:#333;color:#333;}#my-svg .node rect,#my-svg .node circle,#my-svg .node ellipse,#my-svg .node polygon,#my-svg .node path{fill:#fff4dd;stroke:hsl(40.5882352941, 60%, 83.3333333333%);stroke-width:1px;}#my-svg .rough-node .label text,#my-svg .node .label text,#my-svg . image-shape .label,#my-svg .icon-shape .label{text-anchor:middle;}#my-svg .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#my-svg .rough-node .label,#my-svg .node .label,#my-svg .image-shape .label,#my-svg .icon-shape .label{text-align:center;}#my-svg .node.clickable{cursor:pointer;}#my-svg .root .anchor path{fill:#0b0b0b!important;stroke-width:0;stroke:#0b0b0b;}#my-svg .arrowheadPath{fill:#0b0b0b;}#my-svg .edgePaths .path{stroke:#0b0b0b;stroke-width:1px;}#my-svg .flowchart-link{stroke:#0b0b0b;fill:none;}#my-svg .edgeLabel{background-color:hsl(-79.4117647059, 100%, 93.3333333333%);text-align:center;}#my-svg .edgeLabel p{background-color:hsl(-79.4117647059, 100%, 93.3333333333%);}#my-svg .edgeLabel rect{opacity:0.5;background-color:hsl(-79.4117647059, 100%, 93.3333333333%);fill:hsl(-79.4117647059, 100%, 93.3333333333%);}#my-svg .labelBkg{background-color:rgba(243.9999999999, 220.9999999998, 255, 0.5);}#my-svg .cluster rect{fill:hsl(220.5882352941, 100%, 98.3333333333%);stro ke:hsl(220.5882352941, 60%, 88.3333333333%);stroke-width:1px;}#my-svg .cluster text{fill:rgb(8.5000000002, 5.7500000001, 0);}#my-svg .cluster span{color:rgb(8.5000000002, 5.7500000001, 0);}#my-svg .node .collapsed-indicator{fill:hsl(220.5882352941, 60%, 88.3333333333%);stroke:none;opacity:0.6;}#my-svg .node .collapsed-separator{stroke:hsl(220.5882352941, 60%, 88.3333333333%);stroke-width:0.75px;}#my-svg div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"Nimbus Sans",Helvetica,Arial,sans-serif;font-size:12px;background:hsl(220.5882352941, 100%, 98.3333333333%);border:1px solid hsl(220.5882352941, 60%, 88.3333333333%);border-radius:2px;pointer-events:none;z-index:100;}#my-svg .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#my-svg rect.text{fill:none;stroke-width:0;}#my-svg .icon-shape,#my-svg .image-shape{background-color:hsl(-79.4117647059, 100%, 93.3333333333%);text-align:center;}#my-svg .icon-shape p,#my-svg .image-shap e p{background-color:hsl(-79.4117647059, 100%, 93.3333333333%);padding:2px;}#my-svg .icon-shape .label rect,#my-svg .image-shape .label rect{opacity:0.5;background-color:hsl(-79.4117647059, 100%, 93.3333333333%);fill:hsl(-79.4117647059, 100%, 93.3333333333%);}#my-svg .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#my-svg .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#my-svg .node .neo-node{stroke:hsl(40.5882352941, 60%, 83.3333333333%);}#my-svg [data-look="neo"].node rect,#my-svg [data-look="neo"].cluster rect,#my-svg [data-look="neo"].node polygon{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].swimlane.cluster rect{filter:none;}#my-svg [data-look="neo"].node path{stroke:url(#my-svg-gradient);stroke-width:1px;}#my-svg [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].node .neo-line path{str oke:hsl(40.5882352941, 60%, 83.3333333333%);filter:none;}#my-svg [data-look="neo"].node circle{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].node circle .state-start{fill:#000000;}#my-svg [data-look="neo"].icon-shape .icon{fill:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].icon-shape .icon-neo path{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg :root{--mermaid-font-family:"Nimbus Sans",Helvetica,Arial,sans-serif;}

depends on

depends on

d epends on

openembedded-core

meta-custom-1

meta-custom-2

\ No newline at end of file diff --git a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst index 7fdf61c23..38cbc56ab 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst @@ -281,6 +281,69 @@ recursively try to find recipes or append files in this directory. The ``dynamic-recipes/`` directory cannot contain classes or configuration files. Its content is limited to recipes or bbappends. +Parsing Order And Priorities +============================ + +Layers are parsed by BitBake using the :term:`BBLAYERS` variable. The +:term:`BBLAYERS` variable contains a list of paths pointing to the currently +enabled layers. BitBake uses the value of this variable to construct the +:term:`BBPATH` variable: a colon-separated list of paths that is crucial to +understand how assignments and file inclusion priorities work with BitBake. + +The principle is that a layer is prioritized compared to all the layers it +depends on. If two or more layers have exactly the same list of dependencies, +then they are alphabetically ordered, and the last one is prioritized. + +For example, in the following graph: + +.. figure:: svg/layer-dependencies-1.* + :align: center + :width: 70% + +The ``meta-custom-1`` and ``meta-custom-2`` layers both depend on +``openembedded-core``, they have the same dependencies, so the resulting +:term:`BBPATH` will contain the layer paths in this order: + +.. code-block:: text + + /path/to/meta-custom-2:/path/to/meta-custom-1:/path/to/openembedded-core + +.. note:: + + :term:`BBPATH` is iterated from left to right. + +In this context, the ``meta-custom-2`` layer always wins in the following situations: + +- Both layers provide the same machine or distro configuration file. + +- Both layers provide the same recipe with the same version (unless one of them + sets a higher :term:`DEFAULT_PREFERENCE` than the other, or + :term:`PREFERRED_VERSION` selects a specific version for the recipe). + +- Both layers provide the same class. + +If, however, we now change the dependency graph to: + +.. figure:: svg/layer-dependencies-2.* + :align: center + :width: 100% + +Here, we added the information that ``meta-custom-1`` depends on +``meta-custom-2`` (both still depend on ``openembedded-core``). Therefore +``meta-custom-1`` is now prioritized over ``meta-custom-2`` and +``openembedded-core``, because it depends on both. :term:`BBPATH` will now +contain the layer paths in this order: + +.. code-block:: text + + /path/to/meta-custom-1:/path/to/meta-custom-2:/path/to/openembedded-core + +This sort method is called :wikipedia:`topological sorting +`, and is explained in the Python official documentation +for the `graphlib.TopologicalSorter +`__ +class, which BitBake uses internally. + .. _bb-bitbake-providers: Providers diff --git a/doc/bitbake-user-manual/svg/layer-dependencies-1.mmd b/doc/bitbake-user-manual/svg/layer-dependencies-1.mmd new file mode 100644 index 000000000..d8a66267d --- /dev/null +++ b/doc/bitbake-user-manual/svg/layer-dependencies-1.mmd @@ -0,0 +1,14 @@ +--- +config: + theme: base + look: classic + fontFamily: '"Nimbus Sans", Helvetica, Arial, sans-serif' + flowchart: + wrappingWidth: 200 +--- +flowchart LR + openembedded-core["`openembedded-core`"] + meta-custom-1["`meta-custom-1`"] + meta-custom-2["`meta-custom-2`"] + meta-custom-1 -- depends on --> openembedded-core + meta-custom-2 -- depends on --> openembedded-core diff --git a/doc/bitbake-user-manual/svg/layer-dependencies-1.svg b/doc/bitbake-user-manual/svg/layer-dependencies-1.svg new file mode 100644 index 000000000..b9c7405a5 --- /dev/null +++ b/doc/bitbake-user-manual/svg/layer-dependencies-1.svg @@ -0,0 +1 @@ +

depends on

depends on

openembedded-core

meta-custom-1

meta-custom-2

\ No newline at end of file diff --git a/doc/bitbake-user-manual/svg/layer-dependencies-2.mmd b/doc/bitbake-user-manual/svg/layer-dependencies-2.mmd new file mode 100644 index 000000000..756a86032 --- /dev/null +++ b/doc/bitbake-user-manual/svg/layer-dependencies-2.mmd @@ -0,0 +1,15 @@ +--- +config: + theme: base + look: classic + fontFamily: '"Nimbus Sans", Helvetica, Arial, sans-serif' + flowchart: + wrappingWidth: 200 +--- +flowchart LR + openembedded-core["`openembedded-core`"] + meta-custom-1["`meta-custom-1`"] + meta-custom-2["`meta-custom-2`"] + meta-custom-1 -- depends on --> openembedded-core + meta-custom-1 -- depends on --> meta-custom-2 + meta-custom-2 -- depends on --> openembedded-core diff --git a/doc/bitbake-user-manual/svg/layer-dependencies-2.svg b/doc/bitbake-user-manual/svg/layer-dependencies-2.svg new file mode 100644 index 000000000..fb619b586 --- /dev/null +++ b/doc/bitbake-user-manual/svg/layer-dependencies-2.svg @@ -0,0 +1 @@ +