Skip to contentSkip to conversation

sstate: Improve failure to obtain archive message/handling

PATCH New Richard Purdie 1 participant 1 message Jan 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstate: Improve failure to obtain archive message/handling

The bb.fatal() case where sstate failed to find/use an archive in setcene tasks is suboptimal. Bitbakes handling of setscene tasks will be to warn but the fatal will turn this into an error, despite the real task being rerun.

In these failure cases other messages would usually have been printed so turn this into a warning and raise a handled exception status so that bitbake knows to fail the task but not print more messages.

---
 meta/classes/sstate.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/sstate.bbclass +3 -1
index 49d54bc94a7..b45da4fb231 100644
@@ -795,7 +795,9 @@ def sstate_setscene(d):
     shared_state = sstate_state_fromvars(d)
     accelerate = sstate_installpkg(shared_state, d)
     if not accelerate:
-        bb.fatal("No suitable staging package found")
+        msg = "No sstate archive obtainable, will run full task instead."
+        bb.warn(msg)
+        raise bb.BBHandledException(msg)
 
 python sstate_task_prefunc () {
     shared_state = sstate_state_fromvars(d)
Signature · 1 line
2.32.0