Bug 16497 - layerindex: distro configuration leaks into the parsing of a layer's recipes
Summary: layerindex: distro configuration leaks into the parsing of a layer's recipes
Status: IN PROGRESS REVIEW
Alias: None
Product: Layer Index
Classification: Yocto Project Subprojects
Component: Layer Index (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 6.2 M2
Assignee: Tim Orling
QA Contact: apoorv sangal
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-11-14 04:32 UTC by Tim Orling
Modified: 2026-11-14 07:22 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Orling 2026-11-14 04:32:44 UTC
To index a layer's distros, update_layer.py parses each distro configuration file (conf/distro/*.conf) with update_distro_conf_file(), but it parses it into the same datastore it then uses to parse the layer's recipes. Every recipe parsed after a distro configuration in the same run therefore gets that distro's configuration, so its indexed data can be wrong, and parsing can fail.

Example: meta-luneos on scarthgap. After conf/distro/luneos.conf has been parsed, image recipes such as luneos-emulator-appliance.bb fail with:

  bb.data_smart.ExpansionError: Failure expanding variable WEBOS_DISTRO_TOPDIR_BRANCH, expression was ${@oebackport.buildcfg.get_metadata_git_branch(...)}
  NameError: name 'oebackport' is not defined

WEBOS_DISTRO_TOPDIR_BRANCH comes from luneos.inc, which only luneos.conf includes, so these recipes should never see it when indexed. (The NameError itself is bug 16192.) Whether a recipe is affected depends on the order the files are processed in.

Fix: parse each distro configuration file into a copy of the datastore.
Comment 1 Tim Orling 2026-11-14 06:48:35 UTC
Patch sent for review, staged on master-next:

update_layer: don't parse distro configuration into the recipe datastore
https://lore.kernel.org/yocto-patches/20261114044035.88470-2-tim.orling@konsulko.com/