aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-10-27 20:22:34 -0700
committerChris Larson <chris_larson@mentor.com>2010-11-04 11:06:28 -0700
commit3620e5ee5e3e32b592c949b18d2fc06f58024590 (patch)
tree59f61792b687344482559ec9a214bb09e2c95300
parent9cd6a9dcdb323334186f0fe7c4537cd9dc8a58b1 (diff)
downloadopenembedded-3620e5ee5e3e32b592c949b18d2fc06f58024590.zip
openembedded-3620e5ee5e3e32b592c949b18d2fc06f58024590.tar.gz
openembedded-3620e5ee5e3e32b592c949b18d2fc06f58024590.tar.bz2
srctree: don't merge tasks if using B
Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--classes/srctree.bbclass170
1 files changed, 84 insertions, 86 deletions
diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass
index 1a88613..ca19b82 100644
--- a/classes/srctree.bbclass
+++ b/classes/srctree.bbclass
@@ -21,100 +21,98 @@ inherit clean
S = "${FILE_DIRNAME}"
SRC_URI = ""
+def remove_tasks(deltasks, d):
+ for task in filter(lambda k: d.getVarFlag(k, "task"), d.keys()):
+ deps = d.getVarFlag(task, "deps")
+ for preptask in deltasks:
+ if preptask in deps:
+ deps.remove(preptask)
+ d.setVarFlag(task, "deps", deps)
def merge_tasks(d):
- """
- merge_tasks performs two operations:
- 1) removes do_patch and its deps from the build entirely.
- 2) merges all of the operations that occur prior to do_populate_sysroot
- into do_populate_sysroot.
-
- This is necessary, because of recipe variants (normal, native, cross,
- sdk). If a bitbake run happens to want to build more than one of
- these variants in a single run, it's possible for them to step on one
- another's toes, due to the shared ${S}. Interleaved
- configure/compile/install amongst variants will break things badly.
- """
- from itertools import chain
- from bb import note
-
- def __gather_taskdeps(task, seen):
- for dep in d.getVarFlag(task, "deps"):
- if not dep in seen:
- __gather_taskdeps(dep, seen)
- if not task in seen:
- seen.append(task)
-
- def gather_taskdeps(task):
- items = []
- __gather_taskdeps(task, items)
- return items
-
- newtask = "do_populate_sysroot_post"
- mergedtasks = gather_taskdeps(newtask)
- mergedtasks.pop()
- deltasks = gather_taskdeps("do_patch")
-
- for task in (key for key in d.keys()
- if d.getVarFlag(key, "task") and
- not key in mergedtasks):
- deps = d.getVarFlag(task, "deps")
- for mergetask in mergedtasks:
- if mergetask in (d.getVarFlag(task, "recrdeptask"),
- d.getVarFlag(task, "recdeptask"),
- d.getVarFlag(task, "deptask")):
- continue
-
- if mergetask in deps:
- deps.remove(mergetask)
- #note("removing dep on %s from %s" % (mergetask, task))
-
- if not mergetask in deltasks and \
- not newtask in deps:
- #note("adding dep on %s to %s" % (newtask, task))
- deps.append(newtask)
- d.setVarFlag(task, "deps", deps)
-
- for task in mergedtasks[:-1]:
- deps = d.getVarFlag(task, "deps")
- for deltask in deltasks:
- if deltask in deps:
- deps.remove(deltask)
- d.setVarFlag(task, "deps", deps)
-
- # Pull cross recipe task deps over
- depends = []
- deptask = []
- for task in mergedtasks[:-1]:
- if not task in deltasks:
- depends.append(d.getVarFlag(task, "depends") or "")
- deptask.append(d.getVarFlag(task, "deptask") or "")
-
- d.setVarFlag("do_populate_sysroot_post", "depends", " ".join(depends))
- d.setVarFlag("do_populate_sysroot_post", "deptask", " ".join(deptask))
+ """
+ Merges all of the operations that occur prior to do_populate_sysroot
+ into do_populate_sysroot.
+
+ This is necessary because of recipe variants (normal, native, cross,
+ sdk). If a bitbake run happens to want to build more than one of
+ these variants in a single run, it's possible for them to step on one
+ another's toes, due to the shared ${S}. Interleaved
+ configure/compile/install amongst variants will break things badly.
+ """
+ from itertools import chain
+ from bb import note
+
+ def __gather_taskdeps(task, seen):
+ for dep in d.getVarFlag(task, "deps"):
+ if not dep in seen:
+ __gather_taskdeps(dep, seen)
+ if not task in seen:
+ seen.append(task)
+
+ def gather_taskdeps(task):
+ items = []
+ __gather_taskdeps(task, items)
+ return items
+
+ newtask = "do_populate_sysroot_post"
+ mergedtasks = gather_taskdeps(newtask)
+ mergedtasks.pop()
+
+ for task in (key for key in d.keys()
+ if d.getVarFlag(key, "task") and
+ not key in mergedtasks):
+ deps = d.getVarFlag(task, "deps")
+ for mergetask in mergedtasks:
+ if mergetask in (d.getVarFlag(task, "recrdeptask"),
+ d.getVarFlag(task, "recdeptask"),
+ d.getVarFlag(task, "deptask")):
+ continue
+
+ if mergetask in deps:
+ deps.remove(mergetask)
+ #note("removing dep on %s from %s" % (mergetask, task))
+
+ if not newtask in deps:
+ #note("adding dep on %s to %s" % (newtask, task))
+ deps.append(newtask)
+ d.setVarFlag(task, "deps", deps)
+
+ # Pull cross recipe task deps over
+ depends = []
+ deptask = []
+ for task in mergedtasks[:-1]:
+ depends.append(d.getVarFlag(task, "depends") or "")
+ deptask.append(d.getVarFlag(task, "deptask") or "")
+
+ d.setVarFlag("do_populate_sysroot_post", "depends", " ".join(depends))
+ d.setVarFlag("do_populate_sysroot_post", "deptask", " ".join(deptask))
python () {
- merge_tasks(d)
+ remove_tasks(["do_patch", "do_unpack", "do_fetch"], d)
+ b = d.getVar("B", True)
+ if not b or b == d.getVar("S", True):
+ merge_tasks(d)
}
# Manually run do_install & all of its deps
python do_populate_sysroot_post () {
- from os.path import exists
- from bb.build import exec_task, exec_func
- from bb import note
-
- stamp = d.getVar("STAMP", True)
-
- def rec_exec_task(task, seen):
- for dep in d.getVarFlag(task, "deps"):
- if not dep in seen:
- rec_exec_task(dep, seen)
- seen.add(task)
- if not exists("%s.%s" % (stamp, task)):
- note("%s: executing task %s" % (d.getVar("PF", True), task))
- exec_func(task, d)
-
- rec_exec_task("do_populate_sysroot", set())
+ from os.path import exists
+ from bb.build import exec_task, exec_func
+ from bb import note
+
+ stamp = d.getVar("STAMP", True)
+
+ def rec_exec_task(task, seen):
+ for dep in d.getVarFlag(task, "deps"):
+ if not dep in seen:
+ rec_exec_task(dep, seen)
+ seen.add(task)
+ if not exists("%s.%s" % (stamp, task)):
+ note("%s: executing task %s" % (d.getVar("PF", True), task))
+ exec_func(task, d)
+
+ rec_exec_task("do_populate_sysroot", set())
}
addtask populate_sysroot_post after do_populate_sysroot
do_populate_sysroot_post[lockfiles] += "${S}/.lock"