3.10.2.2. Enabling Multiple Configuration Build Dependencies

Sometimes dependencies can exist between targets (multiconfigs) in a multiple configuration build. For example, suppose that in order to build a core-image-sato image for an "x86" multiconfig, the root filesystem of an "arm" multiconfig must exist. This dependency is essentially that the do_image task in the core-image-sato recipe depends on the completion of the do_rootfs task of the core-image-minimal recipe.

To enable dependencies in a multiple configuration build, you must declare the dependencies in the recipe using the following statement form:

     task_or_package[mcdepends] = "multiconfig:from_multiconfig:to_multiconfig:recipe_name:task_on_which_to_depend"
                    

To better show how to use this statement, consider the example scenario from the first paragraph of this section. The following statement needs to be added to the recipe that builds the core-image-sato image:

     do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_rootfs"
                    

In this example, the from_multiconfig is "x86". The to_multiconfig is "arm". The task on which the do_image task in the recipe depends is the do_rootfs task from the core-image-minimal recipe associated with the "arm" multiconfig.

Once you set up this dependency, you can build the "x86" multiconfig using a BitBake command as follows:

     $ bitbake multiconfig:x86:core-image-sato
                   

This command executes all the tasks needed to create the core-image-sato image for the "x86" multiconfig. Because of the dependency, BitBake also executes through the do_rootfs task for the "arm" multiconfig build.

Having a recipe depend on the root filesystem of another build might not seem that useful. Consider this change to the statement in the core-image-sato recipe:

     do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_image"
                   

In this case, BitBake must create the core-image-minimal image for the "arm" build since the "x86" build depends on it.

Because "x86" and "arm" are enabled for multiple configuration builds and have separate configuration files, BitBake places the artifacts for each build in the respective temporary build directories (i.e. TMPDIR).