Inspect recipes from Bitbake's task-depends.dot
and the dependencies between these recipes.
Yocto/Poky ships the script oe-depends-dot which has stopped working some years ago when the output of bitbake -g
changed. The same is true for oe-depends-dot from openembedded-core.
bb-depends-dot
is a replacement.
Example:
# generate `task-depends.dot`
bitbake -g foo
# list recipes with at least one task that recipe "curl" depends on directly
bb-depends-dot task-depends.dot curl
# list recipes that have at least one task that directly depends on a task
# from recipe "curl":
bb-depends-dot task-depends.dot -r curl
# list recipes that have at least one task that transitively depends on a task
# from recipe "curl":
bb-depends-dot task-depends.dot -tr curl
# list recipes with at least one task that recipe "curl" depends on, and list
# all their dependencies
bb-depends-dot task-depends.dot -t curl
Options:
./bb-depends-dot - List dependencies between BitBake recipes.
Usage:
./bb-depends-dot [options] <task-depends.dot>
List all recipes
./bb-depends-dot [options] <task-depends.dot> <recipe_name>
List dependencies of a specific recipe
Options:
--task-depends-dot <file> The task-depends.dot file generated by `bitbake -g`
--recipe <recipe_name> Select a recipe
-d [ --depends ] List dependencies of recipe (default if recipe
given)
-r [ --rdepends ] List reverse dependencies of recipe
-t [ --transitive ] List all transitive dependencies of the given
recipe
-h [ --help ] Print this help message
-V [ --version ] Print version
Navigate to bb-depends-dot's latest release and download bb-depends-dot-static-linux-x86_64-*.zip
.
unzip bb-depends-dot-static-linux-x86_64-*.zip
chmod +x bb-depends-dot
# move this binary to somewhere on your $PATH, e.g.:
mv -i bb-depends-dot ~/.local/bin/
This binary runs on any Linux (x86-64) with GLIBC≥2.14, which was released back in the year 2011.
Dependencies:
- A compiler with
C++17
support, such asg++
≥7 orclang++
≥5 cmake
≥3.10libboost-dev
libboost-graph-dev
libboost-program-options-dev
cd build
cmake ..
make
make install
bitbake -g
generates a file calledtask-depends.dot
containing a graph described with the DOT language.- This graph contains an edge for each dependency between tasks of the recipes contained in a build.
bb-depends-dot
parses thetaks-depends.dot
file to build a graph of the dependencies between recipes.- Transitive dependencies are resolved by using a breadth first search while recording the vertices (i.e. recipes).
- Direct dependencies are resolved by simply recording the adjacent vertices of the directed graph.
- The option
--rdepends
transforms the graph with boost::reverse_graph. - Note that
bb-depends-dot
cannot parse arbitrary DOT. Only the output file ofbitbake -g
is supported.