bbconfigbuild/configfragments.py: set BBPATH in standalone datastore

Otherwise fragments with 'require' statements will not parse,
as the parser will not be able to find files referred to by
those statements.

Add such a statement to the test fragment so that the scenario
is tested.

[YOCTO #15707]

(From OE-Core rev: d88e63d1a7867b3a4ebfc57d472900136b5361d8)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin 2025-01-08 12:25:00 +01:00 committed by Richard Purdie
parent 2d267c418f
commit 70a650c26a
2 changed files with 3 additions and 0 deletions

View File

@ -1,3 +1,5 @@
BB_CONF_FRAGMENT_SUMMARY = "This is a configuration fragment intended for testing in oe-selftest context"
BB_CONF_FRAGMENT_DESCRIPTION = "It defines a variable that can be checked inside the test."
SELFTEST_FRAGMENT_VARIABLE = "somevalue"
require conf/multilib.conf

View File

@ -23,6 +23,7 @@ def plugin_init(plugins):
class ConfigFragmentsPlugin(LayerPlugin):
def get_fragment_info(self, path, name):
d = bb.data.init()
d.setVar('BBPATH', self.tinfoil.config_data.getVar('BBPATH'))
bb.parse.handle(path, d, True)
summary = d.getVar('BB_CONF_FRAGMENT_SUMMARY')
description = d.getVar('BB_CONF_FRAGMENT_DESCRIPTION')