bitbake: doc: bitbake-user-manual: Add more explanations to OVERRIDES
Hi Richard,
I found it confusing to have arm mentioned but not present in the example, and wondered if machine would first be resolved to arm and then used as override. But I also liked the good practice hint.
Will remove the DEPENDS:append and add a space, you are right. I did not test it and only believed what I understood from a youtube video :)
Simon
Am Mo., 15. Nov. 2021 um 13:51 Uhr schrieb Richard Purdie < [email protected]>:
Quoted 118 lines · Simon A. Eugster
Quoted 20 lines
Signed-off-by Simon A. Eugster <[email protected]>--- bitbake/doc/README | 3 +- .../bitbake-user-manual-metadata.rst | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-)bitbake/doc/README +1
-2@@ -47,8 +47,7 @@ To install all required packages run: To build the documentation locally, run: - $ cd documentation - $ make -f Makefile.sphinx html + $ make html The resulting HTML index page will be _build/html/index.html, and you can browse your own copy of the locally generated documentation withQuoted 1 line
diff --git
a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rstb/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rstbitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst It is also possible to append and prepend to shell
Quoted 13 lines
index
119720d527..3449bc1f68100644bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +1
-1@@ -268,7 +268,7 @@ examples:: C = "cval" C =. "test" -The variable :term:`B` contains "bvaladditionaldata" and ``C`` contains +The variable ``B`` contains "bvaladditionaldata" and ``C`` contains "testcval". Appending and Prepending (Override Style Syntax)@@ -300,6 +300,12 @@ It is also possible to append and prepend to shellfunctions and
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst It is also possible to append and prepend to shell · line 300
Quoted 1 line
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +0
-0BitBake-style Python functions. See the":ref:
bitbake-user-manual/bitbake-user-manual-metadata:shell functions" and ":ref:bitbake-user-manual/bitbake-user-manual-metadata:bitbake-style python functions"bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst It is also possible to append and prepend to shell · line 305
Quoted 5 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +3
-0sections for examples. +.. note:: + + Before Honister (3.4), override style used ``_`` instead of ``:``,so you will
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 526
Quoted 12 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +4
-1+ still find a lot of documentation using “_append”, “_prepend”, and + “_remove”. + .. _removing-override-style-syntax: Removal (Override Style Syntax)@@ -517,20 +523,21 @@ variable. - *Selecting a Variable:* The :term:`OVERRIDES` variable is a colon-character-separated list that contains items for which you want to satisfy conditions. Thus, if you have a variable that is - conditional on "arm", and "arm" is in :term:`OVERRIDES`, then the + conditional on "arm", and "arm" is listed in :term:`OVERRIDES`, thenthe
Quoted 12 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +3
-4"arm"-specific version of the variable is used rather than the non-conditional version. Here is an example:: - OVERRIDES = "architecture:os:machine" + OVERRIDES = "foo:linux:arm" TEST = "default" - TEST_os = "osspecific" - TEST_nooverride = "othercondvalue" + TEST:arm = "armspecific" + TEST:nooverride = "othercondvalue" - In this example, the :term:`OVERRIDES`bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 540
Quoted 10 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +6
-4- variable lists three overrides: "architecture", "os", and "machine". - The variable ``TEST`` by itself has a default value of "default". You - select the os-specific version of the ``TEST`` variable by appending - the "os" override to the variable (i.e. ``TEST_os``). + In this example, the :term:`OVERRIDES` variable lists three + overrides: "foo", "linux", and "arm". The variable ``TEST`` by itself + has a default value of "default", and the value of the “arm” specific + version “armspecific” is used because :term:`OVERRIDES` contains + “arm”. The “nooverride” specific version is not used because + :term:`OVERRIDES` does not contain “nooverride”.Why are you removing the mentions of architecture and machine here? It is in
some ways a hint as to how the overrides are used in OE and elsewhere so I'm not
sure that is a good thing to make it generic...Quoted 13 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +3
-0To better understand this, consider a practical example that assumes an OpenEmbedded metadata-based Linux kernel recipe file. The@@ -546,15 +553,21 @@ variable. KBRANCH:qemux86-64 = "standard/common-pc-64/base" KBRANCH:qemumips64 = "standard/mti-malta64" + This works because in poky the :term:`OVERRIDES` variable by default + includes the ``MACHINE`` variable, which is set to e.g. “qemux86”. + - *Appending and Prepending:* BitBake also supports append and prepend operations to variable values based on whether a specific item is listed in :term:`OVERRIDES`. Here is an example::bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 570
Quoted 10 lines
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +4
-1DEPENDS = "glibc ncurses" OVERRIDES = "machine:local" + DEPENDS:append = "defaultappend" DEPENDS:append:machine = "libmad" - In this example, :term:`DEPENDS` becomes "glibc ncurses libmad". + In this example, :term:`DEPENDS` becomes "glibc ncurses libmad". The + default append is ``DEPENDS:append`` is not used because the override + mechanism choses the specific ``:append``.This example looks incorrect to me, I think it would become:
"glibc ncursesdefaultappendlibmad"
Quoted 12 lines
although the example should say DEPENDS:append:machine = " libmad" as there is a
missing space there too.Cheers,
Richard
From 432a7e4a5bbf2c16a2f2182e1dc77f2e5f16ebb5 Mon Sep 17 00:00:00 2001
From: "Simon A. Eugster" <[email protected]>
Date: Mon, 15 Nov 2021 13:30:10 +0100
Subject: [PATCH] bitbake: doc: bitbake-user-manual: Add more explanations to
OVERRIDES
--- bitbake/doc/README | 3 +- .../bitbake-user-manual-metadata.rst | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-)
bitbake/doc/README +1 -2
@@ -47,8 +47,7 @@ To install all required packages run: To build the documentation locally, run: - $ cd documentation - $ make -f Makefile.sphinx html + $ make html The resulting HTML index page will be _build/html/index.html, and you can browse your own copy of the locally generated documentation with
bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +22 -11
@@ -268,7 +268,7 @@ examples:: C = "cval" C =. "test" -The variable :term:`B` contains "bvaladditionaldata" and ``C`` contains +The variable ``B`` contains "bvaladditionaldata" and ``C`` contains "testcval". Appending and Prepending (Override Style Syntax)
@@ -300,6 +300,12 @@ It is also possible to append and prepend to shell functions and BitBake-style Python functions. See the ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:shell functions`" and ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:bitbake-style python functions`" sections for examples. +.. note:: + + Before Honister (3.4), override style used ``_`` instead of ``:``, so you will + still find a lot of documentation using “_append”, “_prepend”, and + “_remove”. + .. _removing-override-style-syntax: Removal (Override Style Syntax)
@@ -517,20 +523,22 @@ variable. - *Selecting a Variable:* The :term:`OVERRIDES` variable is a colon-character-separated list that contains items for which you want to satisfy conditions. Thus, if you have a variable that is - conditional on "arm", and "arm" is in :term:`OVERRIDES`, then the + conditional on "arm", and "arm" is listed in :term:`OVERRIDES`, then the "arm"-specific version of the variable is used rather than the non-conditional version. Here is an example:: - OVERRIDES = "architecture:os:machine" + # Typically, OVERRIDES contains something like architecture:os:machine + OVERRIDES = "linux:arm" TEST = "default" - TEST_os = "osspecific" - TEST_nooverride = "othercondvalue" + TEST:arm = "armspecific" + TEST:nooverride = "othercondvalue" - In this example, the :term:`OVERRIDES` - variable lists three overrides: "architecture", "os", and "machine". - The variable ``TEST`` by itself has a default value of "default". You - select the os-specific version of the ``TEST`` variable by appending - the "os" override to the variable (i.e. ``TEST_os``). + In this example, the :term:`OVERRIDES` variable lists three + overrides: "foo", "linux", and "arm". The variable ``TEST`` by itself + has a default value of "default", and the value of the “arm” specific + version “armspecific” is used because :term:`OVERRIDES` contains + “arm”. The “nooverride” specific version is not used because + :term:`OVERRIDES` does not contain “nooverride”. To better understand this, consider a practical example that assumes an OpenEmbedded metadata-based Linux kernel recipe file. The
@@ -546,13 +554,16 @@ variable. KBRANCH:qemux86-64 = "standard/common-pc-64/base" KBRANCH:qemumips64 = "standard/mti-malta64" + This works because in poky the :term:`OVERRIDES` variable by default + includes the ``MACHINE`` variable, which is set to e.g. “qemux86”. + - *Appending and Prepending:* BitBake also supports append and prepend operations to variable values based on whether a specific item is listed in :term:`OVERRIDES`. Here is an example:: DEPENDS = "glibc ncurses" OVERRIDES = "machine:local" - DEPENDS:append:machine = "libmad" + DEPENDS:append:machine = " libmad" In this example, :term:`DEPENDS` becomes "glibc ncurses libmad".
Signature · 1 line
2.30.2
Hi Simon,
Thank you for proposing documentation improvements!
Quoted 11 lines · Simon A. Eugster
Signed-off-by Simon A. Eugster <[email protected]>--- bitbake/doc/README | 3 +- .../bitbake-user-manual-metadata.rst | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-)bitbake/doc/README +0
-0
bitbake/doc/README To install all required packages run: · line 50
Quoted 6 lines
bitbake/doc/README +1
-2@@ -47,8 +47,7 @@ To install all required packages run: To build the documentation locally, run: - $ cd documentation - $ make -f Makefile.sphinx html + $ make html
What version of the Bitbake manual did you create your patch from? The above changes have already been made last year...
Thanks again
Cheers
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 19 lines · Michael Opdenacker
Hi Simon,
Thank you for proposing documentation improvements!
Quoted 14 lines · Simon A. Eugster
Signed-off-by Simon A. Eugster <[email protected]>--- bitbake/doc/README | 3 +- .../bitbake-user-manual-metadata.rst | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-)bitbake/doc/README +0
-0@@ -47,8 +47,7 @@ To install all required packages run: To build the documentation locally, run:
Quoted 9 lines
bitbake/doc/README To install all required packages run: · line 50
Quoted 3 lines
bitbake/doc/README +1
-2- $ cd documentation - $ make -f Makefile.sphinx html + $ make htmlWhat version of the Bitbake manual did you create your patch from? The above changes have already been made last year...
Thanks again
More generally, patches should be split in individual/independent changes, and this change would not belong to this patch regardless. Like this snippet which was in the original patch sent:
@@ -268,7 +268,7 @@ examples::
C = "cval"
C =. "test"-The variable :term:B contains "bvaladditionaldata" and ``C`` contains +The variable ``B`` contains "bvaladditionaldata" and ``C`` contains
"testcval".
Cheers
Quoted 19 lines
Michael.
--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#2158):
https://lists.yoctoproject.org/g/docs/message/2158
Mute This Topic: https://lists.yoctoproject.org/mt/87068011/1279857
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Now based on the bitbake repository and not on the poky repo!
From e6f9edba285cd89d4fcc9cf55c1f0813d1609ab1 Mon Sep 17 00:00:00 2001
From: "Simon A. Eugster" <[email protected]>
Date: Mon, 29 Nov 2021 08:46:33 +0100
Subject: [PATCH] bitbake: doc: bitbake-user-manual: Add more explanations to
OVERRIDES
--- .../bitbake-user-manual-metadata.rst | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +18 -10
@@ -300,6 +300,12 @@ It is also possible to append and prepend to shell functions and BitBake-style Python functions. See the ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:shell functions`" and ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:bitbake-style python functions`" sections for examples. +.. note:: + + Before Honister (3.4), override style used ``_`` instead of ``:``, so you will + still find a lot of documentation using “_append”, “_prepend”, and + “_remove”. + .. _removing-override-style-syntax: Removal (Override Style Syntax)
@@ -517,20 +523,22 @@ variable. - *Selecting a Variable:* The :term:`OVERRIDES` variable is a colon-character-separated list that contains items for which you want to satisfy conditions. Thus, if you have a variable that is - conditional on "arm", and "arm" is in :term:`OVERRIDES`, then the + conditional on "arm", and "arm" is listed in :term:`OVERRIDES`, then the "arm"-specific version of the variable is used rather than the non-conditional version. Here is an example:: - OVERRIDES = "architecture:os:machine" + # Typically, OVERRIDES contains something like architecture:os:machine + OVERRIDES = "linux:arm" TEST = "default" - TEST_os = "osspecific" - TEST_nooverride = "othercondvalue" + TEST:arm = "armspecific" + TEST:nooverride = "othercondvalue" - In this example, the :term:`OVERRIDES` - variable lists three overrides: "architecture", "os", and "machine". - The variable ``TEST`` by itself has a default value of "default". You - select the os-specific version of the ``TEST`` variable by appending - the "os" override to the variable (i.e. ``TEST_os``). + In this example, the :term:`OVERRIDES` variable lists three + overrides: "foo", "linux", and "arm". The variable ``TEST`` by itself + has a default value of "default", and the value of the “arm” specific + version “armspecific” is used because :term:`OVERRIDES` contains + “arm”. The “nooverride” specific version is not used because + :term:`OVERRIDES` does not contain “nooverride”. To better understand this, consider a practical example that assumes an OpenEmbedded metadata-based Linux kernel recipe file. The
@@ -552,7 +560,7 @@ variable. DEPENDS = "glibc ncurses" OVERRIDES = "machine:local" - DEPENDS:append:machine = "libmad" + DEPENDS:append:machine = " libmad" In this example, :term:`DEPENDS` becomes "glibc ncurses libmad".
Signature · 1 line
2.30.2
PS: Any feedback on this one? :)
Thanks!
Simon
Am Mo., 29. Nov. 2021 um 08:50 Uhr schrieb Simon Eugster <[email protected]
Quoted 4 lines
:
Now based on the bitbake repository and not on the poky repo!
Hi Simon,
Thanks for the update! Apologies for the slow reply.
Quoted 1 line · Simon A. Eugster
Now based on the bitbake repository and not on the poky repo!
Could you send the patch again through "git send-email", please? This way, people can review your patch and make comments or ask questions by replying to specific changes.
Another thing: since this is Bitbake documentation, you should send it to both [email protected] and [email protected], as described in the toplevel README file.
Thanks again. You're very close.
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com