Skip to contentSkip to conversation

bitbake-user-manual: further override syntax updates

PATCH In review Michael Opdenacker 3 participants 4 messages Mar 4, 2022 – Mar 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-user-manual: further override syntax updates

---
I think I found some missing updates for the overrides syntax, but I'm not sure, so please review carefully!

---
 doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +4 -4
index 174cac78..b90e5cf0 100644
@@ -511,7 +511,7 @@ variable.
 .. note::
 
    Overrides can only use lower-case characters. Additionally,
-   underscores are not permitted in override names as they are used to
+   colons are not permitted in override names as they are used to
    separate overrides from each other and from the variable name.
 
 -  *Selecting a Variable:* The :term:`OVERRIDES` variable is a
@@ -523,8 +523,8 @@ variable.
 
       OVERRIDES = "architecture:os:machine"
       TEST = "default"
-      TEST_os = "osspecific"
-      TEST_nooverride = "othercondvalue"
+      TEST:os = "osspecific"
+      TEST:nooverride = "othercondvalue"
 
    In this example, the :term:`OVERRIDES`
    variable lists three overrides: "architecture", "os", and "machine".
@@ -567,7 +567,7 @@ variable.
 -  *Setting a Variable for a Single Task:* BitBake supports setting a
    variable just for the duration of a single task. Here is an example::
 
-      FOO_task-configure = "val 1"
+      FOO:task-configure = "val 1"
       FOO:task-compile = "val 2"
 
    In the
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Michael,

Quoted 14 lines · Michael Opdenacker via lists.openembedded.org

---
I think I found some missing updates for the overrides syntax, but I'm not sure, so please review carefully!

---
  doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +0 -0
index 174cac78..b90e5cf0 100644

doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 516

Quoted 7 lines
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +1 -1
@@ -511,7 +511,7 @@ variable.
  .. note::
 
     Overrides can only use lower-case characters. Additionally,
-   underscores are not permitted in override names as they are used to
+   colons are not permitted in override names as they are used to
     separate overrides from each other and from the variable name.
 

I think we can now safely say that overrides can have underscores, dashes and digits in addition to lowercase characters? I don't know if a variable can start with an underscore, dash or digit but we do have x86_64 and qemux86-64 which are overrides AFAICT? This should show we properly support those "special" characters. Probably would be better in its own commit.

Otherwise, for this commit:

Thanks!
Quentin

#2 lore raw
Quoted 32 lines · Quentin Schulz

Hi Michael,

Quoted 14 lines · Michael Opdenacker via lists.openembedded.org

---
I think I found some missing updates for the overrides syntax, but I'm not sure, so please review carefully!

---
  doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +0 -0
index 174cac78..b90e5cf0 100644

doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 516

Quoted 7 lines
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +1 -1
@@ -511,7 +511,7 @@ variable.
  .. note::
 
     Overrides can only use lower-case characters. Additionally,
-   underscores are not permitted in override names as they are used to
+   colons are not permitted in override names as they are used to
     separate overrides from each other and from the variable name.
 

I think we can now safely say that overrides can have underscores, dashes and digits in addition to lowercase characters? I don't know if a variable can start with an underscore, dash or digit but we do have x86_64 and qemux86-64 which are overrides AFAICT? This should show we properly support those "special" characters. Probably would be better in its own commit.

Quoted 3 lines

Otherwise, for this commit:

Thanks. It does look correct to me too. We do support digits in overrides and dashes. Underscores have a history of being painful and are the reason we have TRANSLATED_TARCH_ARCH:

bitbake.conf:OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable" bitbake.conf:FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
bitbake.conf:TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH').replace("_", "-")}"

although now we use ":" as the override character, we might be able to rethink that.

Cheers,

Richard

#3 lore raw

Hi Richard,

Quoted 39 lines · Richard Purdie
Quoted 31 lines · Quentin Schulz

Hi Michael,

Quoted 14 lines · Michael Opdenacker via lists.openembedded.org

---
I think I found some missing updates for the overrides syntax, but I'm not sure, so please review carefully!

---
  doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +0 -0
index 174cac78..b90e5cf0 100644

doc/bitbake-user-manual/bitbake-user-manual-metadata.rst variable. · line 516

Quoted 7 lines
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +1 -1
@@ -511,7 +511,7 @@ variable.
  .. note::
 
     Overrides can only use lower-case characters. Additionally,
-   underscores are not permitted in override names as they are used to
+   colons are not permitted in override names as they are used to
     separate overrides from each other and from the variable name.
 

I think we can now safely say that overrides can have underscores, dashes and digits in addition to lowercase characters? I don't know if a variable can start with an underscore, dash or digit but we do have x86_64 and qemux86-64 which are overrides AFAICT? This should show we properly support those "special" characters. Probably would be better in its own commit.

Quoted 3 lines

Otherwise, for this commit:

Thanks. It does look correct to me too. We do support digits in overrides and dashes. Underscores have a history of being painful and are the reason we have TRANSLATED_TARCH_ARCH:

Quoted 5 lines

bitbake.conf:OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable" bitbake.conf:FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
bitbake.conf:TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH').replace("_", "-")}"

although now we use ":" as the override character, we might be able to rethink that.

Thanks for the review!
So, can we say that an override can use lowercase characters and also digits and dashes (but not as a first character?)?
Cheers
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com