BitBake Debug
Use this skill to diagnose Yocto/BitBake failures from concrete evidence. Prefer log.do_*, run.do_*, bitbake -e, bitbake-layers, and pkgdata over guesses.
Evidence First
Ask for or inspect:
failing target and task
first fatal error, not only the final summary
tmp/work/.../temp/log.do_<task>
tmp/work/.../temp/run.do_<task>
conf/local.conf
conf/bblayers.conf
affected recipe or bbappend
Useful commands:
bitbake-layers show-layers
bitbake-layers show-recipes <recipe>
bitbake-layers show-appends
bitbake -e <recipe>
bitbake -c listtasks <recipe>
bitbake -c devshell <recipe>
bitbake -g <target>
oe-pkgdata-util list-pkgs
oe-pkgdata-util find-path '*/path/or/file'
Task Playbook
do_fetch: verify SRC_URI, protocol, branch, SRCREV, checksums, network policy, mirrors, DL_DIR, and credentials only when the source is private.
do_unpack: verify archive layout, S, multi-source unpack paths, and subdirectories.
do_patch: verify patch path, strip level, order, fuzz, upstream status, and apply=yes/no only when automatic patch handling is wrong.
do_configure: verify inherited class, PACKAGECONFIG, EXTRA_OECONF, EXTRA_OECMAKE, EXTRA_OEMESON, DEPENDS, and recipe-sysroot.
do_compile: verify compiler command, generated files, missing -native tools, cross variables, and parallel race signs.
do_install: verify installation under ${D}, permissions, ownership, and paths using ${bindir}, ${libdir}, ${sysconfdir}, etc.
do_package / do_package_qa: verify package splits, FILES:*, runtime dependencies, and QA tags.
do_rootfs: verify package names, providers, IMAGE_INSTALL, license policy, package conflicts, and postinstall scripts.
do_image: verify rootfs completion, IMAGE_FSTYPES, WIC kickstart, boot artifacts, and deploy output.
References
- Read references/yocto-field-guide.md for the broader task playbook.
- Read references/qa-errors.md for common QA failures.
- Read references/variables-core.md when the fix depends on variable semantics.
Output
For every diagnosis, provide:
- most likely cause
- evidence that supports it
- exact next command or metadata change
- why this is the Yocto/BitBake fix
- validation command
1---2name: bitbake-debug3description: Debug BitBake and Yocto build failures from task logs, run scripts, metadata expansion, packages, providers, rootfs errors, fetch/patch/configure/compile/install/package/image failures, and common QA messages. Use when the user provides BitBake output, tmp/work logs, do_* task failures, package/rootfs errors, or asks how to diagnose a Yocto build.4---56# BitBake Debug78Use this skill to diagnose Yocto/BitBake failures from concrete evidence. Prefer `log.do_*`, `run.do_*`, `bitbake -e`, `bitbake-layers`, and pkgdata over guesses.910## Evidence First1112Ask for or inspect:1314```text15failing target and task16first fatal error, not only the final summary17tmp/work/.../temp/log.do_<task>18tmp/work/.../temp/run.do_<task>19conf/local.conf20conf/bblayers.conf21affected recipe or bbappend22```2324Useful commands:2526```bash27bitbake-layers show-layers28bitbake-layers show-recipes <recipe>29bitbake-layers show-appends30bitbake -e <recipe>31bitbake -c listtasks <recipe>32bitbake -c devshell <recipe>33bitbake -g <target>34oe-pkgdata-util list-pkgs35oe-pkgdata-util find-path '*/path/or/file'36```3738## Task Playbook3940- `do_fetch`: verify `SRC_URI`, protocol, branch, `SRCREV`, checksums, network policy, mirrors, `DL_DIR`, and credentials only when the source is private.41- `do_unpack`: verify archive layout, `S`, multi-source unpack paths, and subdirectories.42- `do_patch`: verify patch path, strip level, order, fuzz, upstream status, and `apply=yes/no` only when automatic patch handling is wrong.43- `do_configure`: verify inherited class, `PACKAGECONFIG`, `EXTRA_OECONF`, `EXTRA_OECMAKE`, `EXTRA_OEMESON`, `DEPENDS`, and `recipe-sysroot`.44- `do_compile`: verify compiler command, generated files, missing `-native` tools, cross variables, and parallel race signs.45- `do_install`: verify installation under `${D}`, permissions, ownership, and paths using `${bindir}`, `${libdir}`, `${sysconfdir}`, etc.46- `do_package` / `do_package_qa`: verify package splits, `FILES:*`, runtime dependencies, and QA tags.47- `do_rootfs`: verify package names, providers, `IMAGE_INSTALL`, license policy, package conflicts, and postinstall scripts.48- `do_image`: verify rootfs completion, `IMAGE_FSTYPES`, WIC kickstart, boot artifacts, and deploy output.4950## References5152- Read [references/yocto-field-guide.md](references/yocto-field-guide.md) for the broader task playbook.53- Read [references/qa-errors.md](references/qa-errors.md) for common QA failures.54- Read [references/variables-core.md](references/variables-core.md) when the fix depends on variable semantics.5556## Output5758For every diagnosis, provide:59601. most likely cause612. evidence that supports it623. exact next command or metadata change634. why this is the Yocto/BitBake fix645. validation command