Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does bitbake dependency work for source code?

I am a beginner in the ways of the "bitbake" and i wonder what happens in the following situations, when building a project with several thousand packages:

  1. You bitbake the full image (all packages) and it finishes successfully.
  2. You make a change to a package - some source code (let's call it package "X")
  3. You bitbake the full image again.

In step 3 is "X" rebuilt? Is it necessary to increment the PV and PR for "X" to be rebuilt? What happens with a "Y" package that depends on "X"? If X is rebuilt is also "Y" rebuilt?

I know that if you modifiy a .bb file the depending packages are not built because a timestamp is checked. Is it the same mechanism with source code changes? (It's a QT project btw, so in the end bitbake runs qmake->make to make the compilation)

I am using bitbake version 1.13.2.

Thanks

like image 760
user2652479 Avatar asked Aug 05 '13 09:08

user2652479


People also ask

What does BitBake command do?

BitBake is a make-like build tool with the special focus of distributions and packages for embedded Linux cross compilation, although it is not limited to that. It is inspired by Portage, which is the package management system used by the Gentoo Linux distribution.

What does yocto BitBake do?

Fundamentally, BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints.

What language is used to develop BitBake?

Bitbake is a task scheduler that parses Python and Shell script mixed code, which we called Recipes. The code parsed generates and runs tasks. They are a set of steps orders according to the code's dependencies.

How does Yocto Project work?

The Yocto Project employs a collection of components and tools used by the project itself, by project developers, and by those using the Yocto Project. These components and tools are open source projects and metadata that are separate from the reference distribution (Poky) and the OpenEmbedded build system.


1 Answers

Let me try to answer this. for example you have package X, Y and Z. lets say X depends on Y and Y depends on package Z.

  1. If you are doing "bitbake default-image-name" and you are building as scratch (which means none of the package required in the default-image-name is built before). So bitbake now make a dependency tree (you can see dependency tree by "bitbake -g PACKAGE_NAME".). The first package Z will built and then Y and then finally package X.

  2. Now lets say you have made some changes in the X source code and you do "bitbake X" without increasing the PR number in the X recipe file (x.bb), the bitbake don't compile the changes again. I mean to say bitbake just checks the Package Version and Revision (PV and PR). Here we have same Package version (PV) and same Package Revision (PR) so bitbake don't compile the X package again.

To compile the Package X after some modification, You need to apply the changes as a Patch. For that make a patch of changes (eg change.diff or change.patch), add the entry in the X.bb file (see other recipe file for example). after that increase the PR number in the X.bb.

Now "bitbake X" will built the X package again.

  1. Here when we have Increased the PR of X, only the X package get built. Here bitbake will check the dependent package Y and Z which are already built and having the same PR number, it will just use the already built Y and Z package.

  2. If we have rebuilt the Y package (you can clean the package bitbake -c clean package_name if don't want to increase the PR number), the X package will not built again by default even it depends on the Y.

Hope this help.

like image 166
sandeep Avatar answered Sep 21 '22 13:09

sandeep