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
See discussion on mailing list.
https://lists.openembedded.org/g/bitbake-devel/topic/108158309
We are thinking of changing the way layers get added and we could try and take this into account when we do that.