From b8730f68d22b9c1ebd012ffd7aedccd22cceb0da Mon Sep 17 00:00:00 2001 From: Alejandro Enedino Hernandez Samaniego Date: Wed, 25 Jul 2018 09:01:01 -0700 Subject: bitbake: bitbake: Add support for multiconfig dependencies This patch adds the capability for tasks from different multiconfigs to depend on one another. These dependencies can be enabled using the following format: task[mcdepends] = "multiconfig:FROM-MC:TO-MC:PN:task-to-depend-on" For the sake of simplicity consider the following example: Assuming we have set up multiconfig builds, one for qemux86 and one for qemuarm, named x86 and arm respectively. Adding the following line to an image recipe (core-image-sato): do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_rootfs" Would state that core-image-sato:do_image from x86 will depend on core-image-minimal:do_rootfs from arm so it can be executed. This patch makes modifications to: - cooker: To glue both multiconfigs in one place and make sure the dependencies can be provided. - taskdata: To parse and add a new kind of dependency (mcdepends) to the taskdata object. - runqueue: To differentiate tasks from different multiconfigs, add the specified dependencies to the corresponding tasks, and create a working runqueue that contains tasks from both multiconfigs. - siggen: To avoid looking for tasks from different multiconfigs on objects where they dont belong. The taskdata objects are still not aware of the concept of multiconfig, so each object doesnt know which multiconfig its building, hence why the mcdepends are added to all taskdata objects equally (we really dont expect many of these), but the actual dependencies are added only to the required tasks by the runqueue. (Bitbake rev: da8cb8633504bdc815bdcefc538340b9bce5065d) Signed-off-by: Alejandro Enedino Hernandez Samaniego Signed-off-by: Richard Purdie --- bitbake/lib/bb/runqueue.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/runqueue.py') diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index ba9bebebcf..a43c9983a1 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -602,6 +602,19 @@ class RunQueueData: if t in taskData[mc].taskentries: depends.add(t) + def add_mc_dependencies(mc, tid): + mcdeps = taskData[mc].get_mcdepends() + for dep in mcdeps: + mcdependency = dep.split(':') + pn = mcdependency[3] + frommc = mcdependency[1] + mcdep = mcdependency[2] + deptask = mcdependency[4] + if mc == frommc: + fn = taskData[mcdep].build_targets[pn][0] + newdep = '%s:%s' % (fn,deptask) + taskData[mc].taskentries[tid].tdepends.append(newdep) + for mc in taskData: for tid in taskData[mc].taskentries: @@ -618,12 +631,16 @@ class RunQueueData: if fn in taskData[mc].failed_fns: continue + # We add multiconfig dependencies before processing internal task deps (tdepends) + if 'mcdepends' in task_deps and taskname in task_deps['mcdepends']: + add_mc_dependencies(mc, tid) + # Resolve task internal dependencies # # e.g. addtask before X after Y for t in taskData[mc].taskentries[tid].tdepends: - (_, depfn, deptaskname, _) = split_tid_mcfn(t) - depends.add(build_tid(mc, depfn, deptaskname)) + (depmc, depfn, deptaskname, _) = split_tid_mcfn(t) + depends.add(build_tid(depmc, depfn, deptaskname)) # Resolve 'deptask' dependencies # -- cgit v1.2.3-54-g00ecf