[bitbake-devel] Research into exporting BitBake recipes for consumption elsewhere

Sam Thursfield sam.thursfield at codethink.co.uk
Fri Aug 28 15:45:39 UTC 2015


Hi

I wrote a proof-of-concept patch which lets you export all the tasks
from a BitBake project, as actual executable shell and Python scripts.
I'm sharing it here to see if anyone is interested in this sort of
thing, and to see if anyone reading can point out obvious improvements
that I haven't spotted.

This is the first time I've hacked on BitBake's internals, so this code
has quite a lot of room for improvement :-) Exporting is slow (~10
mins), blocks the 'cooker' process completely while it runs, and causes
BitBake to hang once it's finished. But, the generated scripts do
actually work, which is what motived me to share the results.

The goal of this is to have a tool for 'flattening' a set of recipes,
which I think is useful when reasoning about what they actually do.

Right now it produces almost 3GB of output for my test project. This is
mostly because the entire data dict is dumped for each .py file. I've
looked at deduplicating, but my naive implementation was incredibly slow
(checking each variable in the dict for each task dump), and I've not
thought of a more clever approach.

Anyway, I hope this is interesting to someone; I may be able to spend
some time turning it into a viable patch, if there is interest.

Sam

Sam Thursfield (1):
  Make an '--export-tasks' option

 bitbake/lib/bb/cooker.py     |  15 +-
 bitbake/lib/bb/cookerdata.py |   9 +
 bitbake/lib/bb/data.py       |   9 +-
 bitbake/lib/bb/export.py     | 426 +++++++++++++++++++++++++++++++++++++++++++
 bitbake/lib/bb/main.py       |   3 +
 bitbake/lib/bb/runqueue.py   |  11 ++
 6 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 bitbake/lib/bb/export.py

-- 
2.4.3




More information about the bitbake-devel mailing list