6

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

2 Answers2

4

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.

sandeep
  • 1,179
  • 1
  • 7
  • 4
0

Bitbake depends of another systems to compile, for example make. make has the capability to detect if a package needs to be recompile. That is the way bitbake deals with recompiling a package.

juanjosegzl
  • 64
  • 10