Bug 13707 - toaster: import build directory fails if BBLAYERS contains variable reference
Summary: toaster: import build directory fails if BBLAYERS contains variable reference
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.1 M4
Assignee: David Reyna
QA Contact: Toaster default assignee
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-12-16 02:13 UTC by Paul Eggleton
Modified: 2020-03-30 18:31 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: New (Never tested)
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2019-12-16 02:13:31 UTC
Try to import a build directory whose bblayers.conf sets BBLAYERS to a value that includes a variable reference e.g.:

BBLAYERS = "${TOPDIR}/../meta \
            ${TOPDIR}/../meta-selftest"

The import code does not know how to handle this and throws a traceback as a literal "${TOPDIR}/../meta" path does not exist. Looking at buildimport.py, initially I thought the fix would be to properly parse the configuration files using bitbake's own code (e.g using tinfoil), but unfortunately that is not practical since we're not in the right context to invoke bitbake code, and even if we were the build directory may not actually be parseable by the version of bitbake that toaster is running with. (Perhaps this is something we can look at in future after some refactoring.)

The more practical alternative at the moment is to teach the conf reading code how to (a) deal with variable references and (b) specifically about TOPDIR which is typically set by bitbake itself. I have a patch that does this and it appears to work.
Comment 2 David Reyna 2020-03-30 18:31:12 UTC
WIP patch: commit abee806f114fff3565d8796db0eab86f64bb937b