@@ -386,7 +386,9 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c
init_script = os.path.join(bitbake_builddir, "init-build-env")
workspace_file = os.path.join(setupdir, "bitbake.code-workspace")
shell = "bash"
- fragments = bitbake_config.get("oe-fragments", []) + sorted(bitbake_config.get("oe-fragment-choices",{}).values())
+ # oe-fragments entries can be strings or dicts with 'name'/'description' keys
+ oe_fragments = [f["name"] if isinstance(f, dict) else f for f in bitbake_config.get("oe-fragments", [])]
+ fragments = oe_fragments + sorted(bitbake_config.get("oe-fragment-choices",{}).values())
if fragments:
bb.process.run("{} -c '. {} && bitbake-config-build enable-fragment {}'".format(shell, init_script, " ".join(fragments)))
The setup-schema allows oe-fragments entries to be either plain strings or dicts with 'name'/'description' keys, and choose_fragments() already accepts both forms for oe-fragments-one-of options. But setup_bitbake_build() joins the oe-fragments list as-is, so only the plain string form works: "oe-fragments": [ "distro/poky", "core/yocto/sbom-cve-check" ] while a configuration using the dict form, e.g.: "oe-fragments": [ { "name": "distro/poky", "description": "Yocto reference distro" }, { "name": "core/yocto/sbom-cve-check", "description": "Enable SBOM CVE checking" } ] crashes the setup with: TypeError: sequence item 0: expected str instance, dict found Normalize the entries to fragment names before enabling them. v2: normalize oe-fragments entries before concatenating with oe-fragment-choices, rather than over the combined list, per review feedback. AI-Generated: Uses Claude Sonnet Signed-off-by: Fabien Lehoussel <fabien.lehoussel@smile.fr> --- bin/bitbake-setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)