]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: Add documentation for eventhandlers and tweak naming
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Mar 2021 11:38:58 +0000 (11:38 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Mar 2021 22:51:19 +0000 (22:51 +0000)
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>
meta/classes/sstate.bbclass

index 1fa8a63d174ecf62f91e41b9491130301e36548a..8e8efd18d58dea51eb28928ede07182d4f0fc7b2 100644 (file)
@@ -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() {