bbfileconfig: Add class support
RFC PATCH 1/1 bbfileconfig: Add class support
Add support for the class 'BBFILECONFIG' which allows to select the recipes for a given layer.
Example: 'Enable' python3-colorlog recipe from meta-python.
INHERIT += "bbfileconfig"
BBFILECONFIG_meta-python += "python3-colorlog"
---
Hi,
We have developed the 'BBFILECONFIG' class in order to be able to select the recipes we want to parse in an allow list manner. Its meant to control whether a recipe (bb) file from a specic layer is picked to be parsed or not. Similar to the PACKAGECONFIG for packages inside recipes (hence the BBFILECONFIG name).
When handling multiple metadata sources it easily becomes huge to build a full distro ('world'). Current methods (AFAIK) only allows to block/disallow recipe files with BBMASK.
Note: BBFILES_DYNAMIC does part of the job but different use-case.
Could this make sense to upstream? Perhaps there is a better/cleaner way of doing this?
We are currently using this with a reduction of 40k -> 20k packages (per machine). Of course, the class only parses the bb files (and therfore the number of packages to be created) for the recipes we don't want them to be part of our custom distro. This helps us to reduce build times while using directly upstream layers without the need of copying/forking the recipes files in internal layers.
Few extra notes:
1. The class does not handle depencencies. If a recipe is added to the list, the developer should also add manually its depencencies in their respective BBFILECONFIG_<layer>.
2. When multiple recipe files share a common name, some 'unclaimed' recipes will be added too. Example: In meta-openembedded/meta-python we have:
python3-pybind11_2.10.0.bb and python3-pybind11-json_0.2.11.bb. If one wants to add only the first one, the recipe name should be suffixed with '_': BBFILECONFIG_meta-python = "python3-pybind11_"
Unfortunately, if the recipe does not follow <recipe>_<version/git>.bb filename pattern but instead uses <recipe>.bb there would be no way to filter out a second recipe sharing the same recipe name. However, this is perhaps not the recommended way to name a recipe. Is it correct?
3. This class would require the following bitbake patch. Embedding it here as part of the RFC for reference.
lib/bb/cooker.py +10 -0
@@ -1796,6 +1796,15 @@ class CookerExit(bb.event.Event): bb.event.Event.__init__(self) +class CookerStarted(bb.event.Event): + """ + Notify clients of the Cooker started + """ + + def __init__(self): + bb.event.Event.__init__(self) + + class CookerCollectFiles(object): def __init__(self, priorities, mc=''): self.mc = mc
@@ -1834,6 +1843,7 @@ class CookerCollectFiles(object): def collect_bbfiles(self, config, eventdata): """Collect all available .bb build files""" + bb.event.fire(CookerStarted(), eventdata) masked = 0 collectlog.debug("collecting .bb files")
meta/classes/bbfileconfig.bbclass | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 meta/classes/bbfileconfig.bbclass
meta/classes/bbfileconfig.bbclass new file +73 -0
73 lines not on this page · raw message
--
2.35.1