Skip to contentSkip to conversation

ref-manual: faq: add q&a on class appends

PATCH In review Antonin Godard 3 participants 4 messages Oct 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ref-manual: faq: add q&a on class appends

Add the suggestion by Richard to the FAQ, with some minor rewordings and additional punctuations.

---
 documentation/ref-manual/faq.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
documentation/ref-manual/faq.rst +19 -0
index bab284bbfdefae02c284204d3c94891a8238239a..3dcb1f862e24716be703f9fd3e811d2fb9ed34a0 100644
@@ -259,6 +259,25 @@ Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the
 build output yet preserve any source code or downloaded files from
 previous builds, simply remove the ``tmp`` directory.
 
+Why isn't there a way to append bbclass files like bbappend for recipes?
+------------------------------------------------------------------------
+
+The Yocto Project has consciously chosen not to implement such functionality.
+Class code is designed to be shared and reused, and expose some level of
+configuration to its users. We want to encourage people to share these changes
+so we can build the best classes.
+
+If the ``append`` functionality was available for classes, our evidence and
+experience suggests that people would create their custom changes in their
+layer instead of sharing and discussing the issues and/or limitations they
+encountered. This would lead to bizarre class interactions when new layers are
+included. We therefore consciously choose to have a natural pressure to share
+class code improvements or fixes.
+
+There are also technical considerations like which recipes a class append would
+apply to and how that would fit within the layer model. These are complications
+we think we can live without!
+
 Customizing generated images
 ============================
 

---
base-commit: 72bbff33fdce60c133074b4ac09721c4ddac5372
change-id: 20241024-faq-class-append-88bcb9536b39

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw

Hi Antonin,

Quoted 14 lines · Antonin Godard via lists.yoctoproject.org

Add the suggestion by Richard to the FAQ, with some minor rewordings and additional punctuations.

---
  documentation/ref-manual/faq.rst | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
documentation/ref-manual/faq.rst +0 -0
index bab284bbfdefae02c284204d3c94891a8238239a..3dcb1f862e24716be703f9fd3e811d2fb9ed34a0 100644

documentation/ref-manual/faq.rst Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the · line 266

Quoted 8 lines
documentation/ref-manual/faq.rst +5 -0
@@ -259,6 +259,25 @@ Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the
  build output yet preserve any source code or downloaded files from
  previous builds, simply remove the ``tmp`` directory.
 
+Why isn't there a way to append bbclass files like bbappend for recipes?
+------------------------------------------------------------------------
+
+The Yocto Project has consciously chosen not to implement such functionality.
+Class code is designed to be shared and reused, and expose some level of

s/expose/exposes/

except if we meant "class code is designed to expose" rather than "class code exposes"

documentation/ref-manual/faq.rst Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the · line 271

Quoted 5 lines
documentation/ref-manual/faq.rst +5 -0
+configuration to its users. We want to encourage people to share these changes
+so we can build the best classes.
+
+If the ``append`` functionality was available for classes, our evidence and
+experience suggests that people would create their custom changes in their

s/suggests/suggest/ (evidence+experience)

Otherwise looks good to me :)

Cheers,
Quentin

#2 lore raw

Hi Quentin,

Quoted 28 lines · Quentin Schulz

Hi Antonin,

Quoted 14 lines · Antonin Godard via lists.yoctoproject.org

Add the suggestion by Richard to the FAQ, with some minor rewordings and additional punctuations.

---
  documentation/ref-manual/faq.rst | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
documentation/ref-manual/faq.rst +0 -0
index bab284bbfdefae02c284204d3c94891a8238239a..3dcb1f862e24716be703f9fd3e811d2fb9ed34a0 100644

documentation/ref-manual/faq.rst Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the · line 266

Quoted 8 lines
documentation/ref-manual/faq.rst +5 -0
@@ -259,6 +259,25 @@ Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the
  build output yet preserve any source code or downloaded files from
  previous builds, simply remove the ``tmp`` directory.
 
+Why isn't there a way to append bbclass files like bbappend for recipes?
+------------------------------------------------------------------------
+
+The Yocto Project has consciously chosen not to implement such functionality.
+Class code is designed to be shared and reused, and expose some level of

s/expose/exposes/

Quoted 2 lines

except if we meant "class code is designed to expose" rather than "class code exposes"

Agreed it should probably by exposes here.

Quoted 7 lines

documentation/ref-manual/faq.rst Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the · line 271

Quoted 5 lines
documentation/ref-manual/faq.rst +5 -0
+configuration to its users. We want to encourage people to share these changes
+so we can build the best classes.
+
+If the ``append`` functionality was available for classes, our evidence and
+experience suggests that people would create their custom changes in their

s/suggests/suggest/ (evidence+experience)

Good catch. :)

Quoted 6 lines

Otherwise looks good to me :)

Cheers,
Quentin

Thank you!
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#3 lore raw
In reply to Antonin Godard
Quoted 36 lines · Antonin Godard

Add the suggestion by Richard to the FAQ, with some minor rewordings and additional punctuations.

---
 documentation/ref-manual/faq.rst | 19 +++++++++++++++++++

 1 file changed, 19 insertions(+)
documentation/ref-manual/faq.rst +0 -0
index bab284bbfdefae02c284204d3c94891a8238239a..3dcb1f862e24716be703f9fd3e811d2fb9ed34a0 100644
@@ -259,6 +259,25 @@ Within the :term:`Build Directory`, is the ``tmp`` directory. To remove all the

 build output yet preserve any source code or downloaded files from previous builds, simply remove the ``tmp`` directory.

documentation/ref-manual/faq.rst +19 -0
+Why isn't there a way to append bbclass files like bbappend for recipes?
+------------------------------------------------------------------------
+
+The Yocto Project has consciously chosen not to implement such functionality.
+Class code is designed to be shared and reused, and expose some level of
+configuration to its users. We want to encourage people to share these changes
+so we can build the best classes.
+
+If the ``append`` functionality was available for classes, our evidence and
+experience suggests that people would create their custom changes in their
+layer instead of sharing and discussing the issues and/or limitations they
+encountered. This would lead to bizarre class interactions when new layers are
+included. We therefore consciously choose to have a natural pressure to share
+class code improvements or fixes.
+
+There are also technical considerations like which recipes a class append would
+apply to and how that would fit within the layer model. These are complications
+we think we can live without!
+
Quoted 3 lines

 Customizing generated images
 ============================

Looks good, thanks!

If/as/when I see anything else which should be in there I'll try and note something down. We should really try and collect more of these.

Cheers,

Richard