https://github.com/thomastrapp/bb-depends-dot
List recipes from BitBake's task-depends.dot and the dependencies between these recipes
https://github.com/thomastrapp/bb-depends-dot
bitbake oe-depends-dot open-embedded poky recipes yocto
Last synced: 6 months ago
JSON representation
List recipes from BitBake's task-depends.dot and the dependencies between these recipes
- Host: GitHub
- URL: https://github.com/thomastrapp/bb-depends-dot
- Owner: thomastrapp
- License: mit
- Created: 2021-07-09T15:41:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-03T16:43:05.000Z (over 3 years ago)
- Last Synced: 2025-03-26T22:04:06.179Z (7 months ago)
- Topics: bitbake, oe-depends-dot, open-embedded, poky, recipes, yocto
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 23
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bb-depends-dot
==============Inspect recipes from Bitbake's `task-depends.dot` and the dependencies between these recipes.
[Yocto/Poky](https://github.com/yoctoproject/poky) ships the script [oe-depends-dot](https://github.com/yoctoproject/poky/blob/cd369a732e17e57794a89519de6bab3847330630/scripts/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](https://github.com/openembedded/openembedded-core/blob/0441b53d55a919b5ac42e997f4092053b017b553/scripts/oe-depends-dot) from [openembedded-core](https://github.com/openembedded/openembedded-core).
`bb-depends-dot` is a replacement.Example:
```shell
# 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]
List all recipes./bb-depends-dot [options]
List dependencies of a specific recipeOptions:
--task-depends-dot The task-depends.dot file generated by `bitbake -g`
--recipe 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
```## Install
Navigate to [bb-depends-dot's latest release](https://github.com/thomastrapp/bb-depends-dot/releases/latest) and download `bb-depends-dot-static-linux-x86_64-*.zip`.
```shell
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.
## Build from source:
Dependencies:
* A compiler with `C++17` support, such as `g++` ≥7 or `clang++` ≥5
* `cmake` ≥3.10
* `libboost-dev`
* `libboost-graph-dev`
* `libboost-program-options-dev````
cd build
cmake ..
make
make install
```## How it works:
* `bitbake -g` generates a file called `task-depends.dot` containing a graph described with the [DOT language](https://en.wikipedia.org/wiki/DOT_(graph_description_language)).
* This graph contains an edge for each dependency between [tasks](https://docs.yoctoproject.org/ref-manual/tasks.html) of the [recipes](https://docs.yoctoproject.org/dev-manual/common-tasks.html#writing-a-new-recipe) contained in a build.
* `bb-depends-dot` [parses](https://github.com/thomastrapp/bb-depends-dot/blob/master/ragel/dot-machine.rl) the `taks-depends.dot` file to build a [graph](https://github.com/thomastrapp/bb-depends-dot/blob/master/bbrd/bbrd/DependencyGraph.h) of the [dependencies](https://github.com/thomastrapp/bb-depends-dot/blob/master/bbrd/bbrd/Dependencies.h) 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](https://www.boost.org/doc/libs/1_77_0/libs/graph/doc/reverse_graph.html).
* Note that `bb-depends-dot` cannot parse arbitrary DOT. Only the output file of `bitbake -g` is supported.