]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: Improve failure to obtain archive message/handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 19 Jan 2022 17:50:33 +0000 (17:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 19 Jan 2022 23:03:02 +0000 (23:03 +0000)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index 49d54bc94a70155db7e16637f3a3c47d62f636ea..b45da4fb23159353522f2127cb807b0ab825d225 100644 (file)
@@ -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)