Bitbake debugger
Skill BenGardiner/bitbake-yocto-agent-skills/bitbake-debugger
Agent skills for making and fixing bitbake stuff
npx -y skills add BenGardiner/bitbake-yocto-agent-skills --skill bitbake-debuggerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Troubleshoots Yocto/BitBake build failures, task errors, and sstate cache misses. Use when a build fails with a specific error, a task needs isolation in a devshell, or a variable value needs tracing via bitbake-getvar. Do not use for initial metadata setup, generic Linux debugging, or analyzing package dependencies in a successful image.
SKILL.md
2.8 KB, as published. Nobody here has run it
BitBake Debugging Procedures
Follow these steps to resolve BitBake failures, variable overrides, and cache issues.
1. Interrogate the Datastore
Use these commands to discover where variables are defined or overridden.
- Trace a specific variable: Run
bitbake-getvar -r <recipe> <VARIABLE_NAME>to see a history of every operation (set, append, prepend) and the specific file/line responsible for each change. - Dump the full environment: Run
bitbake -e <recipe>to view the entire environment after parsing. Pipe the output togrepto find variable definitions or understand why an override (like_append) is not functioning. - Variable/Environment Inspector: Use the helper script to extract a specific variable value quietly.
This script sources the environment and uses./.gemini/skills/bitbake-debugger/scripts/get_recipe_env.sh <VARIABLE_NAME> [recipe_name]bitbake-getvar --valueto return only the requested string.
2. Isolate and Reproduce Task Failures
When a specific task (e.g., do_compile) fails, isolate its execution environment rather than digging through the main BitBake output.
- Launch a devshell: Run
bitbake <recipe> -c devshellto open an interactive shell mimicking the exact environment of the failing task. - Trace script execution: Once inside the devshell (you will be in the source directory), locate the task's execution script at
../temp/run.do_<task>. Edit this file and addset -xat the top to enable a real-time command trace, then execute it.
3. Debug Task Signatures (Sstate Cache Issues)
If BitBake unexpectedly rebuilds a component or fails to rebuild one, investigate the task signatures.
- Find signature differences: Run
bitbake <recipe> -S printdiff. This attempts to find the closest match in the sstate cache and usesbitbake-diffsigsto report exactly which variable or dependency changed to cause the cache miss.
4. Advanced Logging and Output
- Enable maximum verbosity: Add
-DDDto the BitBake command to reveal why BitBake chose a specific provider or version for a package. - Inject custom logs: For custom recipes, inject markers into the logs by adding
bb.debug(level, "message")orbb.warn("message")within Python tasks. Run the build with the-vflag to ensure these appear in the terminal. - Visualize dependencies: Run
bitbake -g <target>to generate dependency graphs to visualize build order and complex dependencies.