summaryrefslogtreecommitdiffstats
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:25 +0000
commit5fa2455fbba90c17a7c93c7362a426d17525c92b (patch)
treef15695534db18a2f9cc4f2c6848ffb12e8e8cab9
parent75c2c03416a7e3864fb18b31690815ab249e117b (diff)
downloadpoky-5fa2455fbba90c17a7c93c7362a426d17525c92b.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. (From OE-Core rev: 2b5c553744804f44a17b61c345e482027e45b71e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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() {
1146 1146
1147SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1" 1147SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"
1148 1148
1149# Event handler which removes manifests and stamps file for 1149#
1150# recipes which are no longer reachable in a build where they 1150# Event handler which removes manifests and stamps file for recipes which are no
1151# once were. 1151# longer 'reachable' in a build where they once were. 'Reachable' refers to
1152# whether a recipe is parsed so recipes in a layer which was removed would no
1153# longer be reachable. Switching between systemd and sysvinit where recipes
1154# became skipped would be another example.
1155#
1152# Also optionally removes the workdir of those tasks/recipes 1156# Also optionally removes the workdir of those tasks/recipes
1153# 1157#
1154addhandler sstate_eventhandler2 1158addhandler sstate_eventhandler_reachablestamps
1155sstate_eventhandler2[eventmask] = "bb.event.ReachableStamps" 1159sstate_eventhandler_reachablestamps[eventmask] = "bb.event.ReachableStamps"
1156python sstate_eventhandler2() { 1160python sstate_eventhandler_reachablestamps() {
1157 import glob 1161 import glob
1158 d = e.data 1162 d = e.data
1159 stamps = e.stamps.values() 1163 stamps = e.stamps.values()
@@ -1224,6 +1228,17 @@ python sstate_eventhandler2() {
1224 os.remove(preservestampfile) 1228 os.remove(preservestampfile)
1225} 1229}
1226 1230
1231
1232#
1233# Bitbake can generate an event showing which setscene tasks are 'stale',
1234# i.e. which ones will be rerun. These are ones where a stamp file is present but
1235# it is stable (e.g. taskhash doesn't match). With that list we can go through
1236# the manifests for matching tasks and "uninstall" those manifests now. We do
1237# this now rather than mid build since the distribution of files between sstate
1238# objects may have changed, new tasks may run first and if those new tasks overlap
1239# with the stale tasks, we'd see overlapping files messages and failures. Thankfully
1240# removing these files is fast.
1241#
1227addhandler sstate_eventhandler_stalesstate 1242addhandler sstate_eventhandler_stalesstate
1228sstate_eventhandler_stalesstate[eventmask] = "bb.event.StaleSetSceneTasks" 1243sstate_eventhandler_stalesstate[eventmask] = "bb.event.StaleSetSceneTasks"
1229python sstate_eventhandler_stalesstate() { 1244python sstate_eventhandler_stalesstate() {