summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-23 11:38:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-23 22:51:19 +0000
commit2b5c553744804f44a17b61c345e482027e45b71e (patch)
tree04f45dcc71d98ee6cb81758bff749f2be166a912 /meta
parent60e77b1777c6c304aa1d629c4cfdabe0daa22eb1 (diff)
downloadopenembedded-core-2b5c553744804f44a17b61c345e482027e45b71e.tar.gz
sstate: Add documentation for eventhandlers and tweak naming
It isn't immediately obvious what these do, add some better examples to document them. Also improve the naming for one of the handlers. This will help make it clear in any tracebacks which code is being used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sstate.bbclass27
1 files changed, 21 insertions, 6 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 1fa8a63d17..8e8efd18d5 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -1146,14 +1146,18 @@ python sstate_eventhandler() {
SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"
-# Event handler which removes manifests and stamps file for
-# recipes which are no longer reachable in a build where they
-# once were.
+#
+# Event handler which removes manifests and stamps file for recipes which are no
+# longer 'reachable' in a build where they once were. 'Reachable' refers to
+# whether a recipe is parsed so recipes in a layer which was removed would no
+# longer be reachable. Switching between systemd and sysvinit where recipes
+# became skipped would be another example.
+#
# Also optionally removes the workdir of those tasks/recipes
#
-addhandler sstate_eventhandler2
-sstate_eventhandler2[eventmask] = "bb.event.ReachableStamps"
-python sstate_eventhandler2() {
+addhandler sstate_eventhandler_reachablestamps
+sstate_eventhandler_reachablestamps[eventmask] = "bb.event.ReachableStamps"
+python sstate_eventhandler_reachablestamps() {
import glob
d = e.data
stamps = e.stamps.values()
@@ -1224,6 +1228,17 @@ python sstate_eventhandler2() {
os.remove(preservestampfile)
}
+
+#
+# Bitbake can generate an event showing which setscene tasks are 'stale',
+# i.e. which ones will be rerun. These are ones where a stamp file is present but
+# it is stable (e.g. taskhash doesn't match). With that list we can go through
+# the manifests for matching tasks and "uninstall" those manifests now. We do
+# this now rather than mid build since the distribution of files between sstate
+# objects may have changed, new tasks may run first and if those new tasks overlap
+# with the stale tasks, we'd see overlapping files messages and failures. Thankfully
+# removing these files is fast.
+#
addhandler sstate_eventhandler_stalesstate
sstate_eventhandler_stalesstate[eventmask] = "bb.event.StaleSetSceneTasks"
python sstate_eventhandler_stalesstate() {