diff mbox series

[1/2] bitbake-setup: rename bb-layers -> bb-layers-in-sources, bb-layers-relative -> bb-layers-in-thisdir

Message ID 20251107080026.2599821-1-alex.kanavin@gmail.com
State New
Headers show
Series [1/2] bitbake-setup: rename bb-layers -> bb-layers-in-sources, bb-layers-relative -> bb-layers-in-thisdir | expand

Commit Message

Alexander Kanavin Nov. 7, 2025, 8 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

As pointed out by Peter K, bb-layers and bb-layers-relative is a confusing way
to name these lists:
https://lists.openembedded.org/g/bitbake-devel/message/18296

I do believe this is the best option of several, it's yet another rename,
but also a super important one, and the only chance to get the best
nomenclature is now.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 bin/bitbake-setup                             | 14 +++++------
 .../configurations/oe-nodistro.conf.json      |  2 +-
 .../configurations/poky-master.conf.json      |  2 +-
 lib/bb/tests/setup.py                         | 24 +++++++++----------
 4 files changed, 21 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 29fdf1189..50b7f1488 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -129,7 +129,7 @@  def checkout_layers(layers, layerdir, d):
     return layers_fixed_revisions
 
 def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
-    def _setup_build_conf(layers, relative_layers, build_conf_dir):
+    def _setup_build_conf(layers, thisdir_layers, build_conf_dir):
         os.makedirs(build_conf_dir)
         layers_s = []
 
@@ -137,11 +137,11 @@  def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
             l = os.path.join(layerdir, l)
             layers_s.append("  {} \\".format(l))
 
-        for l in relative_layers:
+        for l in thisdir_layers:
             if thisdir:
                 l = os.path.join(thisdir, l)
             else:
-                raise Exception("Configuration is using bb-layers-relative to specify " \
+                raise Exception("Configuration is using bb-layers-in-this-dir to specify " \
                 "a layer path relative to itself. This can be done only " \
                 "when the configuration is specified by its path on local " \
                 "disk, not when it's in a registry or is fetched over http.")
@@ -209,9 +209,9 @@  def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
     print("Setting up bitbake configuration in\n    {}\n".format(bitbake_builddir))
 
     template = bitbake_config.get("oe-template")
-    layers = bitbake_config.get("bb-layers")
+    layers = bitbake_config.get("bb-layers-in-sources")
     if not template and not layers:
-        print("Bitbake configuration does not contain a reference to an OpenEmbedded build template via 'oe-template' or a list of layers via 'bb-layers'; please use oe-setup-build, oe-init-build-env or another mechanism manually to complete the setup.")
+        print("Bitbake configuration does not contain a reference to an OpenEmbedded build template via 'oe-template' or a list of layers via 'bb-layers-in-sources'; please use oe-setup-build, oe-init-build-env or another mechanism manually to complete the setup.")
         return
     oesetupbuild = os.path.join(layerdir, 'setup-build')
     if template and not os.path.exists(oesetupbuild):
@@ -223,8 +223,8 @@  def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
         os.rename(bitbake_confdir, backup_bitbake_confdir)
 
     if layers:
-        relative_layers = bitbake_config.get("bb-layers-relative") or []
-        _setup_build_conf(layers, relative_layers, bitbake_confdir)
+        thisdir_layers = bitbake_config.get("bb-layers-in-this-dir") or []
+        _setup_build_conf(layers, thisdir_layers, bitbake_confdir)
 
     if template:
         bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir))
diff --git a/default-registry/configurations/oe-nodistro.conf.json b/default-registry/configurations/oe-nodistro.conf.json
index 7619738b1..cd3c5f612 100644
--- a/default-registry/configurations/oe-nodistro.conf.json
+++ b/default-registry/configurations/oe-nodistro.conf.json
@@ -43,7 +43,7 @@ 
         {
             "name": "nodistro",
             "description": "OpenEmbedded 'nodistro'",
-            "bb-layers": ["openembedded-core/meta"],
+            "bb-layers-in-sources": ["openembedded-core/meta"],
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json
index 60531ba02..5a580197b 100644
--- a/default-registry/configurations/poky-master.conf.json
+++ b/default-registry/configurations/poky-master.conf.json
@@ -53,7 +53,7 @@ 
     "bitbake-setup": {
         "configurations": [
         {
-            "bb-layers": ["openembedded-core/meta","meta-yocto/meta-yocto-bsp","meta-yocto/meta-poky"],
+            "bb-layers-in-sources": ["openembedded-core/meta","meta-yocto/meta-yocto-bsp","meta-yocto/meta-poky"],
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py
index ba2a90009..b8a5a03ad 100644
--- a/lib/bb/tests/setup.py
+++ b/lib/bb/tests/setup.py
@@ -122,7 +122,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
             {
                 "name": "gizmo-env-passthrough",
                 "description": "Gizmo configuration with environment-passthrough",
-                "bb-layers": ["layerC","layerD/meta-layer"],
+                "bb-layers-in-sources": ["layerC","layerD/meta-layer"],
                 "oe-fragments": ["test-fragment-1"],
                 "bb-env-passthrough-additions": [
                     "BUILD_ID",
@@ -138,20 +138,20 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
             {
                 "name": "gadget-notemplate",
                 "description": "Gadget notemplate configuration",
-                "bb-layers": ["layerA","layerB/meta-layer"],
+                "bb-layers-in-sources": ["layerA","layerB/meta-layer"],
                 "oe-fragments": ["test-fragment-1"]
             },
             {
                 "name": "gizmo-notemplate",
                 "description": "Gizmo notemplate configuration",
-                "bb-layers": ["layerC","layerD/meta-layer"],
+                "bb-layers-in-sources": ["layerC","layerD/meta-layer"],
                 "oe-fragments": ["test-fragment-2"]
             },
             {
-                "name": "gizmo-notemplate-with-relative-layers",
-                "description": "Gizmo notemplate configuration using relative layers",
-                "bb-layers": ["layerC","layerD/meta-layer"],
-                "bb-layers-relative": ["layerE/meta-layer"],
+                "name": "gizmo-notemplate-with-thisdir-layers",
+                "description": "Gizmo notemplate configuration using thisdir layers",
+                "bb-layers-in-sources": ["layerC","layerD/meta-layer"],
+                "bb-layers-in-this-dir": ["layerE/meta-layer"],
                 "oe-fragments": ["test-fragment-2"]
             }
         ]
@@ -204,14 +204,14 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
                 self.assertIn(bitbake_config["description"], f.read())
             with open(os.path.join(bb_conf_path, 'bblayers.conf')) as f:
                 bblayers = f.read()
-                for l in bitbake_config["bb-layers"]:
+                for l in bitbake_config["bb-layers-in-sources"]:
                     self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
-                for l in bitbake_config.get("bb-layers-relative") or []:
-                    relative_layer = os.path.join(
+                for l in bitbake_config.get("bb-layers-in-this-dir") or []:
+                    thisdir_layer = os.path.join(
                             os.path.dirname(config_upstream["path"]),
                             l,
                         )
-                    self.assertIn(relative_layer, bblayers)
+                    self.assertIn(thisdir_layer, bblayers)
 
         if 'oe-fragment' in bitbake_config.keys():
             for f in bitbake_config["oe-fragments"]:
@@ -298,7 +298,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
                                                                   'gizmo-env-passthrough',
                                                                   'gizmo-no-fragment',
                                                                   'gadget-notemplate','gizmo-notemplate',
-                                                                  'gizmo-notemplate-with-relative-layers')}
+                                                                  'gizmo-notemplate-with-thisdir-layers')}
                                }
         for cf, v in test_configurations.items():
             for c in v['buildconfigs']: