Bug 15587 - Processing of LAYERDIR during layer parsing causes loss of data
Summary: Processing of LAYERDIR during layer parsing causes loss of data
Status: NEW
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.0.3
Hardware: All x86_64
: Medium+ normal
Target Milestone: 6.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-09-04 09:27 UTC by Adam Blank
Modified: 2026-09-10 15:13 UTC (History)
6 users (show)

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 Adam Blank 2024-09-04 09:27:55 UTC
Current implementation of expandVarref has the following undesired characteristics:

- ref = '${%s}' % variable
  This line discriminates this type of variable reference ${@d.getVar('LAYERDIR')}"
  which causes them to always resolve to None

- referrervalue = self.getVar(key, False)
  if referrervalue and isinstance(referrervalue, str) and ref in referrervalue:
      self.setVar(key, referrervalue.replace(ref, value))
  This block (the serVar() call in particular) has the effect,
  that variables which reference LAYERDIR lose their append/prepend/remove data.
  During the call to expandVarref('LAYERDIR'), whichever append/prepend/remove
  apply at the moment are used by getVar(), and then they are all dropped by serVar(),
  including the ones whose OVERRIDES would come from layers parsed later
Comment 1 Randy MacLeod 2024-09-05 14:36:34 UTC
See discussion on mailing list.
Comment 3 Richard Purdie 2026-09-10 15:13:03 UTC
We are thinking of changing the way layers get added and we could try and take this into account when we do that.