Patchwork [bitbake-devel] toaster: task with outcome 2 (sstate), should have sstate_result!=0

login
register
mail settings
Submitter Cristiana Voicu
Date Nov. 15, 2013, 11:34 a.m.
Message ID <1384515286-17662-1-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/61771/
State New
Headers show

Comments

Cristiana Voicu - Nov. 15, 2013, 11:34 a.m.
0 (not applicable) is not a valid sstate_result for tasks with
outcome 2 (sstate), which should return 3 (restored), 2
(failed) or 1 (missed).
Sstate_result for tasks with outcome 2 is equal to the outcome
of _setscene corespondent task.

[YOCTO #5220]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py |    6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index fbf7546..7e3b572 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -93,6 +93,12 @@  class ORMWrapper(object):
         # if we got covered by a setscene task, we're SSTATE
         if task_object.outcome == Task.OUTCOME_COVERED and 1 == Task.objects.filter(task_executed=True, build = task_object.build, recipe = task_object.recipe, task_name=task_object.task_name+"_setscene").count():
             task_object.outcome = Task.OUTCOME_SSTATE
+            outcome_task_setscene = Task.objects.get(task_executed=True, build = task_object.build,
+                                    recipe = task_object.recipe, task_name=task_object.task_name+"_setscene").outcome
+            if outcome_task_setscene == Task.OUTCOME_SUCCESS:
+                task_object.sstate_result = Task.SSTATE_RESTORED
+            elif outcome_task_setscene == Task.OUTCOME_FAILED:
+                task_object.sstate_result = Task.SSTATE_FAILED
 
         # mark down duration if we have a start time
         if 'start_time' in task_information.keys():