Search code examples
builddependenciesbitbake

How to use DEPENDS in bitbake


I have a bitbake build environment with multiple recipes, which are dependent in a chain.

At the moment I have to do: bitbake recipe1 && bitbake recipe2

I have added: DEPENDS = "recipe1" to the meta-recipe2/recipe2.bb

bitbake-layers show-cross-depends shows this dependency.

There fore I expect running bitbake recipe2 to build recipe1 first, however it does not.

What do I need to do to build the dependencies listend in the DEPENDS variable?


Solution

  • Adding recipe1 to recipe2by

    DEPENDS += "recipe1"
    

    should work fine for you. The line above means that before the do_configure task of recipe2 can be run, the task do_populate_sysroot from recipe1 will have to be completed. This should work for all versions of bitbake and OpenEmbedded.

    You can achieve something similar to DEPENDS += "recipe1" by

    do_configure[depends] += "recipe1:do_populate_sysroot"
    

    If necessary, you could manually set up your own custom depends like this.