summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-16 15:32:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-19 15:18:04 +0000
commitb43faba37816817edc5240a139361d16e07c6131 (patch)
treee24006d469c45eb7085e89d88c7977bb218f3bd0 /meta
parent30001153d3ce7dadf8f1ec79e634a638a9994518 (diff)
downloadopenembedded-core-b43faba37816817edc5240a139361d16e07c6131.tar.gz
openembedded-core-b43faba37816817edc5240a139361d16e07c6131.tar.bz2
openembedded-core-b43faba37816817edc5240a139361d16e07c6131.zip
sstate: Implement a setscene dependency validation routine to allow skipping of some sstate installation
This is a first attempt at logic to determine when a sstate dependency needs to be installed and when it does not. Its a start at the logic and errs on the side of caution, as it gets wider testing, we can refine the logic as needed. This code should allow a significant performance speedup to certain workflows, for example "bitbake xxx-image -c rootfs" will not populate the target sysroot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sstate.bbclass52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index c085c626d8..470e0eeca7 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -620,3 +620,55 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
return ret
+BB_SETSCENE_DEPVALID = "setscene_depvalid"
+
+def setscene_depvalid(task, taskdependees, notneeded, d):
+ # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME]
+ # task is included in taskdependees too
+
+ bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task])))
+
+ def isNative(x):
+ return x.endswith("-native")
+ def isNativeCross(x):
+ return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial")
+ def isSafeDep(x):
+ if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross"]:
+ return True
+ return False
+
+ # We can skip these "safe" dependencies since the aren't runtime dependencies, just build time
+ if isSafeDep(taskdependees[task][0]) and taskdependees[task][1] == "do_populate_sysroot":
+ return True
+
+ # We only need to trigger populate_lic through direct dependencies
+ if taskdependees[task][1] == "do_populate_lic":
+ return True
+
+ for dep in taskdependees:
+ bb.debug(2, " considering dependency: %s" % (str(taskdependees[dep])))
+ if task == dep:
+ continue
+ if dep in notneeded:
+ continue
+ # do_package_write_* and do_package doesn't need do_package
+ if taskdependees[task][1] == "do_package" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+ continue
+ # do_package_write_* and do_package doesn't need do_populate_sysroot
+ if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+ continue
+ # Native/Cross packages don't exist and are noexec anyway
+ if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+ continue
+ # Native/Cross populate_sysroot need their dependencies
+ if isNativeCross(taskdependees[task][0]) and isNativeCross(taskdependees[dep][0]) and taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot':
+ return False
+ # Target populate_sysroot do not need their dependencies
+ if taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot':
+ continue
+
+ # Safe fallthrough default
+ bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])))
+ return False
+ return True
+