Dependency handling

BitBake handles dependencies at the task level since to allow for efficient operation with multiple processed executing in parallel. A robust method of specifying task dependencies is therefore needed.

Dependencies internal to the .bb file

Where the dependencies are internal to a given .bb file, the dependencies are handled by the previously detailed addtask directive.

Build Dependencies

DEPENDS lists build time dependencies. The 'deptask' flag for tasks is used to signify the task of each item listed in DEPENDS which must have completed before that task can be executed.

do_configure[deptask] = "do_populate_staging"

means the do_populate_staging task of each item in DEPENDS must have completed before do_configure can execute.

Runtime Dependencies

The PACKAGES variable lists runtime packages and each of these can have RDEPENDS and RRECOMMENDS runtime dependencies. The 'rdeptask' flag for tasks is used to signify the task of each item runtime dependency which must have completed before that task can be executed.

do_package_write[rdeptask] = "do_package"

means the do_package task of each item in RDEPENDS must have completed before do_package_write can execute.

Recursive Dependencies

These are specified with the 'recrdeptask' flag which is used signify the task(s) of dependencies which must have completed before that task can be executed. It works by looking though the build and runtime dependencies of the current recipe as well as any inter-task dependencies the task has, then adding a dependency on the listed task. It will then recurse through the dependencies of those tasks and so on.

It may be desireable to recurse not just through the dependencies of those tasks but through the build and runtime dependencies of dependent tasks too. If that is the case, the taskname itself should be referenced in the task list, e.g. do_a[recrdeptask] = "do_a do_b".

Inter task

The 'depends' flag for tasks is a more generic form of which allows an interdependency on specific tasks rather than specifying the data in DEPENDS.

do_patch[depends] = "quilt-native:do_populate_staging"

means the do_populate_staging task of the target quilt-native must have completed before the do_patch can execute.

The 'rdepends' flag works in a similar way but takes targets in the runtime namespace instead of the build time dependency namespace.