Skip to contentSkip to conversation

cooker: check if target contains task

PATCH Superseded Ed Bartosh 2 participants 4 messages Sep 9, 2016 – Sep 15, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 cooker: check if target contains task

Task name was incorrectly added to the targets that already contained :task suffix and fired with BuildInit event. This caused Toaster to create incorrect Target objects and show them in UI.

[YOCTO #10221]

---
 bitbake/lib/bb/cooker.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +2 -1
index b7d7a7e..2952f9e 100644
@@ -1421,7 +1421,8 @@ class BBCooker:
         if not task.startswith("do_"):
             task = "do_%s" % task
 
-        packages = ["%s:%s" % (target, task) for target in targets]
+        packages = [target if ':' in target else '%s:%s' (target, task) for target in targets]
+
         bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
 
         taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 21 lines · Ed Bartosh

Task name was incorrectly added to the targets that already contained :task suffix and fired with BuildInit event. This caused Toaster to create incorrect Target objects and show them in UI.

[YOCTO #10221]

---
 bitbake/lib/bb/cooker.py | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +0 -0
index b7d7a7e..2952f9e 100644
@@ -1421,7 +1421,8 @@ class BBCooker:

         if not task.startswith("do_"):
             task = "do_%s" % task

-        packages = ["%s:%s" % (target, task) for target in targets]

Quoted 8 lines

+        packages = [target if ':' in target else '%s:%s' (target, task) for target in targets]
+
         bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)

         taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)

I put this into a build without looking too closely, the result was near enough everything failed with failures like:

http://autobuilder.yocto.io:8010/builders/buildtools/builds/37

Cheers,

Richard

author
#2 lore raw
Quoted 34 lines · Richard Purdie
Quoted 21 lines · Ed Bartosh

Task name was incorrectly added to the targets that already contained :task suffix and fired with BuildInit event. This caused Toaster to create incorrect Target objects and show them in UI.

[YOCTO #10221]

---
 bitbake/lib/bb/cooker.py | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +0 -0
index b7d7a7e..2952f9e 100644
@@ -1421,7 +1421,8 @@ class BBCooker:

         if not task.startswith("do_"):
             task = "do_%s" % task

-        packages = ["%s:%s" % (target, task) for target in targets]

Quoted 8 lines

+        packages = [target if ':' in target else '%s:%s' (target, task) for target in targets]
+
         bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)

         taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)

I put this into a build without looking too closely, the result was near enough everything failed with failures like:

Quoted 2 lines

http://autobuilder.yocto.io:8010/builders/buildtools/builds/37

Sorry for the typo. I'll send an update in a minute.

--
Regards,
Ed

author
#3 lore raw

PATCH v2 1/1 cooker: check if target contains task

In reply to Richard Purdie

Task name was incorrectly added to the targets that already contained :task suffix and fired with BuildInit event. This caused Toaster to create incorrect Target objects and show them in UI.

[YOCTO #10221]

---
 bitbake/lib/bb/cooker.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +2 -1
index b7d7a7e..3fc96b1 100644
@@ -1421,7 +1421,8 @@ class BBCooker:
         if not task.startswith("do_"):
             task = "do_%s" % task
 
-        packages = ["%s:%s" % (target, task) for target in targets]
+        packages = [target if ':' in target else '%s:%s' % (target, task) for target in targets]
+
         bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
 
         taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)
Signature · 1 line
2.1.4