| Summary: |
expandKeys() doesn't expand in definition order |
| Product: |
[Build System, Metadata & Runtime] BitBake
|
Reporter: |
Haris Okanovic <haris.okanovic> |
| Component: |
bitbake | Assignee: |
Richard Purdie <richard.purdie> |
| Status: |
RESOLVED
NOTABUG
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
Undecided
|
CC: |
poky.bs.watcher, poky.watcher
|
| Version: |
unspecified | |
|
| Target Milestone: |
--- | |
|
| Hardware: |
x86 | |
|
| OS: |
Multiple | |
|
| Whiteboard: |
|
|
OS type for building Yocto:
|
---
|
Type of Regression:
|
---
|
|
Verified:
|
|
Documentation change:
|
No (bug/feature does not impact docs)
|
Consider the following bb snippet: VAR_foo = "base" AAA = "foo" BBB = "${AAA}" VAR_${BBB} = "wrong" VAR_${AAA} = "right" VAR_foo expands to "wrong", which is very unintuitive. The problem happens in lib.bb.data.expandKeys() which expands variables alphabetically instead of definition order. It first renames VAR_${AAA} --> VAR_foo == "right" then renames VAR_${BBB} --> VAR_foo --> "wrong", instead of the other way around. You can reproduce this in OpenEmbedded by simply copying the 5-line bb snippet above into any recipe X, and run `bitbake -e X | grep '^VAR_foo='` .