[RFC] Proposal: New tool to display recipe dependency trees

Osama Abdelkader <[email protected]>
Newsgroups org.yoctoproject.lists.yocto,org.openembedded.lists.bitbake-devel
Message-ID <aSSUtHYFQlychNQk@osama>
Hi All,

I would like to propose adding a new command-line tool (or BitBake subcommand) that generates
dependency trees, including:

DEPENDS (build-time)
RDEPENDS (runtime)
Optional graph output (text, JSON)

Motivation

Currently, BitBake provides:

bitbake -g produces task-depends.dot (task-level, not recipe-level, must use graphviz)
oe-pkgdata-util runtime dependency only
bitbake -e <recipe> view variables, but manually
Errors from the dependency resolver (if a recipe is missing)

But there is no built-in CLI tool to display a recipe dependency tree, e.g.:

bitbake-deptree dnf

dnf
 ├── libdnf
 │    ├── libsolv
 │    └── json-c
 └── sqlite3


Such a tool would help:

layer developers understanding complex deps
learning how Yocto resolves recipe names, PROVIDES, virtual/ mappings
documenting or visualizing architecture

I started experimenting with a prototype using Tinfoil to walk DEPENDS and collect data through BitBake’s recipecache, and it seems feasible.

Questions for the community

Before developing this further, I would like guidance on the following:

Is this functionality valuable upstream? Would BitBake benefit from such a tool?

Where should it live?
Options I see:

new BitBake subcommand (e.g. bitbake-deptree)
extension to oe-pkgdata-util
standalone Python tool under scripts/
part of devtool?

Preferred output format(s)?
Plain ASCII tree (default)
JSON


Should the tool:

cover only DEPENDS (build-time)?
include RDEPENDS with pkgdata?
resolve virtual/ providers?

Any prior work I may have missed?

If the idea is acceptable, I will prepare a proper implementation and send a patchset to the appropriate mailing list.
Thank you for your feedback!

Best regards,
Osama
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.