From 695998f921b691f196825e9067b6db399d691e53 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 9 May 2023 13:55:01 +0100 Subject: bitbake: cooker: Add FILE_LAYERNAME variable containing the layername for a recipe There are times when it would be useful for code to know which layer (or collection in old bitbake terms) it is contained within. Add support for FILE_LAYERNAME to be set by bitbake when parsing a recipe so that it is possible to determine this. To do it, we need to pass data from the cooker into the recipe endpoints, since only the top level cooker information knows about the layer structure which makes the patch a bit painful. The idea is that this would make layer overrides possible: OVERRIDES .= ":layer-${FILE_LAYERNAME}" which then opens possibilities like: WARN_QA:append:layer-core = " patch-fuzz" as an example where OE-Core could enable specific QA tests only for that specific layer. (Bitbake rev: 7090a14b0035842112d073acf7f2ed1a01fdeccf) Signed-off-by: Richard Purdie --- bitbake/bin/bitbake-worker | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake/bin/bitbake-worker') diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index d743ff5105..451e6926bf 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker @@ -151,6 +151,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, extraconfigdata, runtask): taskhash = runtask['taskhash'] unihash = runtask['unihash'] appends = runtask['appends'] + layername = runtask['layername'] taskdepdata = runtask['taskdepdata'] quieterrors = runtask['quieterrors'] # We need to setup the environment BEFORE the fork, since @@ -262,7 +263,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, extraconfigdata, runtask): bb.parse.siggen.set_taskhashes(workerdata["newhashes"]) ret = 0 - the_data = databuilder.parseRecipe(fn, appends) + the_data = databuilder.parseRecipe(fn, appends, layername) the_data.setVar('BB_TASKHASH', taskhash) the_data.setVar('BB_UNIHASH', unihash) bb.parse.siggen.setup_datacache_from_datastore(fn, the_data) -- cgit v1.2.3-54-g00ecf