Skip to contentSkip to conversation

ref-manual: classes: clarify native/nativesdk classes exclusive options

PATCH Applied Quentin Schulz 3 participants 5 messages Jun 6, 2025 – Jun 24, 2025

lore
Share & tools
lore
#0 lore raw

cover ref-manual: classes: clarify native/nativesdk classes exclusive options

Someone recently misread the documentation and did both options, that is name the recipe with -native and add BBCLASSEXTEND = "native" to it.

So this hopefully make it clearer by rewording the second item in the bullet list.

At the same time, put the nativesdk note about the filename for the first bullet point within the first bullet point, like for the similar native note.

Reading through this class documentation for the first time, I had this random thought:

What happens if I want a recipe to be native and nativesdk but not target?

---
Quentin Schulz (2):
ref-manual: classes: reword to clarify that native/nativesdk options are exclusive
ref-manual: classes: nativesdk: move note to appropriate section

 documentation/ref-manual/classes.rst | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

---
base-commit: 406e8a8e30404c0538f5aa46f211540bae2b206b
change-id: 20250606-native-options-9456be705f04

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH 1/2 ref-manual: classes: reword to clarify that native/nativesdk options are exclusive

From: Quentin Schulz <[email protected]>

We explain how to create a native (nativesdk) recipe in two different ways via a bullet list but reading quickly the instructions may mislead one into doing both options whereas they are incompatible.

This rewords both the nativesdk and native sections so that the second bullet point starts with an Or and explicit that this applies to target recipes.

---
 documentation/ref-manual/classes.rst | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
documentation/ref-manual/classes.rst +4 -2
index 54a98bf24f3e75a20646a0daa87ce29c6df0e18c..b5121aec0f28eaaee43db107977f45d43ee45801 100644
@@ -2050,7 +2050,8 @@ a couple different ways:
       Not using this naming convention can lead to subtle problems
       caused by existing code that depends on that naming convention.
 
--  Create or modify a target recipe that contains the following::
+-  Or, create a :ref:`ref-classes-native` variant of any target recipe (e.g.
+   ``myrecipe.bb``) by adding the following to the recipe::
 
       BBCLASSEXTEND = "native"
 
@@ -2081,7 +2082,8 @@ couple different ways:
    inherit statement in the recipe after all other inherit statements so
    that the :ref:`ref-classes-nativesdk` class is inherited last.
 
--  Create a :ref:`ref-classes-nativesdk` variant of any recipe by adding the following::
+-  Or, create a :ref:`ref-classes-nativesdk` variant of any target recipe (e.g.
+   ``myrecipe.bb``) by adding the following to the recipe::
 
        BBCLASSEXTEND = "nativesdk"
 
Signature · 1 line
2.49.0
#2 lore raw

PATCH 2/2 ref-manual: classes: nativesdk: move note to appropriate section

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

The nativesdk- prefix to the recipe filename should only be used when using the inherit method as the BBCLASSEXTEND method will do some magic when generating the "implicit" name of the recipe.

This matches the instructions for the native class.

---
 documentation/ref-manual/classes.rst | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
documentation/ref-manual/classes.rst +10 -10
index b5121aec0f28eaaee43db107977f45d43ee45801..da2bd028d8b96f27ca222fd72358ba0b64be5126 100644
@@ -2082,6 +2082,16 @@ couple different ways:
    inherit statement in the recipe after all other inherit statements so
    that the :ref:`ref-classes-nativesdk` class is inherited last.
 
+   .. note::
+
+      When creating a recipe, you must follow this naming convention::
+
+              nativesdk-myrecipe.bb
+
+
+      Not doing so can lead to subtle problems because there is code that
+      depends on the naming convention.
+
 -  Or, create a :ref:`ref-classes-nativesdk` variant of any target recipe (e.g.
    ``myrecipe.bb``) by adding the following to the recipe::
 
@@ -2092,16 +2102,6 @@ couple different ways:
    specify any functionality specific to the respective SDK machine or
    target case.
 
-.. note::
-
-   When creating a recipe, you must follow this naming convention::
-
-           nativesdk-myrecipe.bb
-
-
-   Not doing so can lead to subtle problems because there is code that
-   depends on the naming convention.
-
 Although applied differently, the :ref:`ref-classes-nativesdk` class is used with both
 methods. The advantage of the second method is that you do not need to
 have two separate recipes (assuming you need both) for the SDK machine
Signature · 1 line
2.49.0
#3 lore raw
In reply to Quentin Schulz
Quoted 2 lines · Quentin Schulz

What happens if I want a recipe to be native and nativesdk but not target?

They can’t if they use BBCLASSEXTEND, as the default is a target. I guess you could do some anonpy and skiprecipe in target builds.

Or have explicit native and nativesdk recipes, that share 99% of their content.

Ross
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#4 lore raw
In reply to Quentin Schulz
Quoted 11 lines · Quentin Schulz

Someone recently misread the documentation and did both options, that is name the recipe with -native and add BBCLASSEXTEND = "native" to it.

So this hopefully make it clearer by rewording the second item in the bullet list.

At the same time, put the nativesdk note about the filename for the first bullet point within the first bullet point, like for the similar native note.

[...]

Applied, thanks!

[1/2] ref-manual: classes: reword to clarify that native/nativesdk options are exclusive

      commit: 6d0d338a5f2686ddeee5eed7b6e05f3db800d33a
[2/2] ref-manual: classes: nativesdk: move note to appropriate section
      commit: 15fe239e1e62b9add737aa732dd7f5e9948ee03d

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>