summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-02-13 13:12:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-09 12:23:57 -0700
commit3d0bb418a08aa96dd57c15b695385775ce3bddc8 (patch)
treef39bb8adbf421f0296b4d97434bd105f01e88a8a /bitbake
parent7008a24792704b8e757c583663636addf49f397d (diff)
downloadpoky-3d0bb418a08aa96dd57c15b695385775ce3bddc8.tar.gz
bitbake: toasterui: adding new task outcome empty
In order to separate tasks with invalid states from the no exec tasks, we add a new value OUTCOME_EMPTY for the tasks. OUTCOME_EMPTY has the same value as OUTCOME_NA as to maintain compatibility with already existing builds. New value for OUTCOME_NA can be used to detect tasks with invalid states, i.e. it should never appear after finishing a build. Fixing noexec tasks outcomes. [YOCTO #5763] (Bitbake rev: 475643ad78796835bf2e731b9d0fa5794ec80dd1) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py27
-rw-r--r--bitbake/lib/toaster/orm/models.py7
2 files changed, 20 insertions, 14 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 0a8073f916..4c9c96b1bc 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -458,7 +458,7 @@ class BuildInfoHelper(object):
458 task_information['task_executed'] = True 458 task_information['task_executed'] = True
459 if 'noexec' in vars(event) and event.noexec == True: 459 if 'noexec' in vars(event) and event.noexec == True:
460 task_information['task_executed'] = False 460 task_information['task_executed'] = False
461 task_information['outcome'] = Task.OUTCOME_NA 461 task_information['outcome'] = Task.OUTCOME_EMPTY
462 task_information['script_type'] = Task.CODING_NA 462 task_information['script_type'] = Task.CODING_NA
463 463
464 # do not assign order numbers to scene tasks 464 # do not assign order numbers to scene tasks
@@ -468,7 +468,10 @@ class BuildInfoHelper(object):
468 468
469 task_obj = self.orm_wrapper.get_update_task_object(task_information) 469 task_obj = self.orm_wrapper.get_update_task_object(task_information)
470 470
471 self.internal_state[identifier] = {'start_time': datetime.datetime.now()} 471 self.internal_state[identifier] = {
472 'start_time': datetime.datetime.now(),
473 'outcome': task_information['outcome'],
474 }
472 475
473 476
474 def store_tasks_stats(self, event): 477 def store_tasks_stats(self, event):
@@ -489,10 +492,9 @@ class BuildInfoHelper(object):
489 recipe_information = self._get_recipe_information_from_taskfile(event.taskfile) 492 recipe_information = self._get_recipe_information_from_taskfile(event.taskfile)
490 recipe = self.orm_wrapper.get_update_recipe_object(recipe_information) 493 recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
491 task_information = self._get_task_information(event,recipe) 494 task_information = self._get_task_information(event,recipe)
492 try: 495
493 task_information['start_time'] = self.internal_state[identifier]['start_time'] 496 task_information['start_time'] = self.internal_state[identifier]['start_time']
494 except: 497 task_information['outcome'] = self.internal_state[identifier]['outcome']
495 pass
496 498
497 if 'logfile' in vars(event): 499 if 'logfile' in vars(event):
498 task_information['logfile'] = event.logfile 500 task_information['logfile'] = event.logfile
@@ -507,13 +509,14 @@ class BuildInfoHelper(object):
507 else: 509 else:
508 task_information['script_type'] = Task.CODING_SHELL 510 task_information['script_type'] = Task.CODING_SHELL
509 511
510 if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)): 512 if task_information['outcome'] == Task.OUTCOME_NA:
511 task_information['outcome'] = Task.OUTCOME_SUCCESS 513 if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
512 del self.internal_state[identifier] 514 task_information['outcome'] = Task.OUTCOME_SUCCESS
515 del self.internal_state[identifier]
513 516
514 if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)): 517 if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
515 task_information['outcome'] = Task.OUTCOME_FAILED 518 task_information['outcome'] = Task.OUTCOME_FAILED
516 del self.internal_state[identifier] 519 del self.internal_state[identifier]
517 520
518 self.orm_wrapper.get_update_task_object(task_information) 521 self.orm_wrapper.get_update_task_object(task_information)
519 522
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index f96da9c339..af44d86ff3 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -93,20 +93,22 @@ class Task(models.Model):
93 (CODING_SHELL, 'Shell'), 93 (CODING_SHELL, 'Shell'),
94 ) 94 )
95 95
96 OUTCOME_NA = -1
96 OUTCOME_SUCCESS = 0 97 OUTCOME_SUCCESS = 0
97 OUTCOME_COVERED = 1 98 OUTCOME_COVERED = 1
98 OUTCOME_CACHED = 2 99 OUTCOME_CACHED = 2
99 OUTCOME_PREBUILT = 3 100 OUTCOME_PREBUILT = 3
100 OUTCOME_FAILED = 4 101 OUTCOME_FAILED = 4
101 OUTCOME_NA = 5 102 OUTCOME_EMPTY = 5
102 103
103 TASK_OUTCOME = ( 104 TASK_OUTCOME = (
105 (OUTCOME_NA, 'Not Available'),
104 (OUTCOME_SUCCESS, 'Succeeded'), 106 (OUTCOME_SUCCESS, 'Succeeded'),
105 (OUTCOME_COVERED, 'Covered'), 107 (OUTCOME_COVERED, 'Covered'),
106 (OUTCOME_CACHED, 'Cached'), 108 (OUTCOME_CACHED, 'Cached'),
107 (OUTCOME_PREBUILT, 'Prebuilt'), 109 (OUTCOME_PREBUILT, 'Prebuilt'),
108 (OUTCOME_FAILED, 'Failed'), 110 (OUTCOME_FAILED, 'Failed'),
109 (OUTCOME_NA, 'Not Available'), 111 (OUTCOME_EMPTY, 'Empty'),
110 ) 112 )
111 113
112 search_allowed_fields = [ "recipe__name", "task_name" ] 114 search_allowed_fields = [ "recipe__name", "task_name" ]
@@ -142,6 +144,7 @@ class Task(models.Model):
142 144
143 class Meta: 145 class Meta:
144 ordering = ('order', 'recipe' ,) 146 ordering = ('order', 'recipe' ,)
147 unique_together = ('build', 'recipe', 'task_name', )
145 148
146 149
147class Task_Dependency(models.Model): 150class Task_Dependency(models.Model):