summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-11-06 18:08:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-06 18:04:13 +0000
commit516039e60916da4c3bb39f0d0c18d721e7ecf75e (patch)
tree5bb500e91d0a5ed97ca7244ac9b5ea6b4a376ee3 /bitbake/lib/bb
parent9780ec24d070b0638492c0f153a7ed776c150ed5 (diff)
downloadpoky-516039e60916da4c3bb39f0d0c18d721e7ecf75e.tar.gz
bitbake: bitbake-setup: replace {THISDIR} token with a keyword: bb-layers-relative
{THISDIR} is a special value token that can be used in the list of enabled layers to specify the layer location relative to the confguration file: https://git.openembedded.org/bitbake/commit/?id=b3153be29de8b8570b0c184369bd41f4c646cf92 This replaces the token with an explicit separate keyword for such layers: so that special processing to determine the final value can be avoided, and the feature can be formalized in the json schema: instead of "bb-layers": [ "{THISDIR}/meta-my-project" ] this allows "bb-layers-relative": [ "meta-my-project" Going forward I think we should strive to avoid any further special value tokens. (Bitbake rev: 90da82bd2bfcfd5590c9ae06015737b616074b56) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/tests/setup.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py
index 767a6298da..ba2a90009d 100644
--- a/bitbake/lib/bb/tests/setup.py
+++ b/bitbake/lib/bb/tests/setup.py
@@ -148,9 +148,10 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
148 "oe-fragments": ["test-fragment-2"] 148 "oe-fragments": ["test-fragment-2"]
149 }, 149 },
150 { 150 {
151 "name": "gizmo-notemplate-with-thisdir", 151 "name": "gizmo-notemplate-with-relative-layers",
152 "description": "Gizmo notemplate configuration using THISDIR", 152 "description": "Gizmo notemplate configuration using relative layers",
153 "bb-layers": ["layerC","layerD/meta-layer","{THISDIR}/layerE/meta-layer"], 153 "bb-layers": ["layerC","layerD/meta-layer"],
154 "bb-layers-relative": ["layerE/meta-layer"],
154 "oe-fragments": ["test-fragment-2"] 155 "oe-fragments": ["test-fragment-2"]
155 } 156 }
156 ] 157 ]
@@ -204,14 +205,13 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
204 with open(os.path.join(bb_conf_path, 'bblayers.conf')) as f: 205 with open(os.path.join(bb_conf_path, 'bblayers.conf')) as f:
205 bblayers = f.read() 206 bblayers = f.read()
206 for l in bitbake_config["bb-layers"]: 207 for l in bitbake_config["bb-layers"]:
207 if l.startswith('{THISDIR}/'): 208 self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
208 thisdir_layer = os.path.join( 209 for l in bitbake_config.get("bb-layers-relative") or []:
210 relative_layer = os.path.join(
209 os.path.dirname(config_upstream["path"]), 211 os.path.dirname(config_upstream["path"]),
210 l.removeprefix("{THISDIR}/"), 212 l,
211 ) 213 )
212 self.assertIn(thisdir_layer, bblayers) 214 self.assertIn(relative_layer, bblayers)
213 else:
214 self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
215 215
216 if 'oe-fragment' in bitbake_config.keys(): 216 if 'oe-fragment' in bitbake_config.keys():
217 for f in bitbake_config["oe-fragments"]: 217 for f in bitbake_config["oe-fragments"]:
@@ -298,7 +298,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
298 'gizmo-env-passthrough', 298 'gizmo-env-passthrough',
299 'gizmo-no-fragment', 299 'gizmo-no-fragment',
300 'gadget-notemplate','gizmo-notemplate', 300 'gadget-notemplate','gizmo-notemplate',
301 'gizmo-notemplate-with-thisdir')} 301 'gizmo-notemplate-with-relative-layers')}
302 } 302 }
303 for cf, v in test_configurations.items(): 303 for cf, v in test_configurations.items():
304 for c in v['buildconfigs']: 304 for c in v['buildconfigs']: