Bug 8910

Summary: Toaster builds fail at the rootfs stage
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Ed Bartosh <eduard.bartosh>
Status: VERIFIED FIXED QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: High CC: alexandru.costinx.roman, belen.barros.pena, brian.avery, jessica.zhang, richard.purdie, stanciux.mihail
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Belen Barros Pena 2016-01-12 14:51:42 UTC
Found in master:1724ffd32d1c169a2de66f2cb88ba18c56da6146

After the recent changes to the do_rootfs task, Toaster builds fail. The errors shown are:

No such task: do_image_jffs2
No such task: do_image_ext3

According to RP: "It appears that the way toaster sets IMAGE_FSTYPES, its getting set too late for the anonymous python code which now processes that variable"
Comment 1 Richard Purdie 2016-01-12 15:42:04 UTC
The problem is that toaster sets IMAGEFS_TYPES into the server/cooker with setVariable, however when workers are spawned as new processes, they don't get this updated variable and see the original value.

This means that there is inconsistency between the cooker/server and the workers and the workers then complain that the task doesn't exist. The change that triggers this is that the tasks are created by anonymous python code which processes IMAGE_FSTYPES now. If the value isn't in IMAGE_FSTYPES, the task doesn't exist.
Comment 2 Richard Purdie 2016-01-12 15:48:49 UTC
Just to illustrate/confirm the problem and how it can be worked around, this patch does 'resolve' the issue:

diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 3df783b..8340d42 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -202,6 +202,7 @@ def fork_off_task(worker, cfg, data, workerdata, fn, task, taskname, appends, ta
             data.setVar("BUILDNAME", workerdata["buildname"])
             data.setVar("DATE", workerdata["date"])
             data.setVar("TIME", workerdata["time"])
+            data.setVar("IMAGE_FSTYPES", workerdata["imagefstypes"])
             bb.parse.siggen.set_taskdata(workerdata["sigdata"])
             ret = 0
             try:
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index f78a3b1..a647e7e 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -910,6 +910,7 @@ class RunQueue:
             "buildname" : self.cfgData.getVar("BUILDNAME", True),
             "date" : self.cfgData.getVar("DATE", True),
             "time" : self.cfgData.getVar("TIME", True),
+            "imagefstypes" : self.cfgData.getVar("IMAGE_FSTYPES", True),
         }
 
         worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>")


Sadly there is a more fundamental issue in toaster that really needs to get fixed there though and bitbake shouldn't have to special case IMAGE_FSTYPES.
Comment 3 Ed Bartosh 2016-01-12 16:55:19 UTC
Does it mean that Toaster should set variables two ways - by using setVariable call(for cooker) and by writing them into configuration file(for worker)?
Comment 4 Richard Purdie 2016-01-12 16:58:36 UTC
(In reply to comment #3)
> Does it mean that Toaster should set variables two ways - by using
> setVariable call(for cooker) and by writing them into configuration file(for
> worker)?

If you set the variables into the configuration files, wouldn't bitbake pick those up in both cooker and worker?
Comment 5 brian avery 2016-01-12 17:00:16 UTC
I prefer the configuration files. That way, I can rerun a toaster build from the command line if I'd like to. That ability is part of the reason I wanted the command line and toaster ui approach to coexist :)
Comment 6 Ed Bartosh 2016-01-17 19:48:55 UTC
Started to work on this.
Comment 7 Ed Bartosh 2016-01-17 21:40:43 UTC
Belen, can you try if code in the ed/toaster/builds-fail-at-the-rootfs-stage-8910 fixes this?
Comment 8 Belen Barros Pena 2016-01-18 08:16:41 UTC
(In reply to comment #7)
> Belen, can you try if code in the
> ed/toaster/builds-fail-at-the-rootfs-stage-8910 fixes this?

A build of core-image-minimal completed without problems with this branch. So it seems to be working for me. 

Thanks!

Belén
Comment 9 Ed Bartosh 2016-01-18 09:28:54 UTC
Sent patch for review to toaster ml: https://lists.yoctoproject.org/pipermail/toaster/2016-January/003701.html
Comment 10 Ed Bartosh 2016-01-20 09:43:48 UTC
The fix got merged into bitbake master: http://cgit.openembedded.org/bitbake/commit/?id=3c2c269dbbbd9a56bd1d0cb4de676baaf3b7ce88
Comment 11 Alexandru Roman 2016-01-28 11:24:57 UTC
Verified on master: 3d2c0f5902cacf9d8544bf263b51ef0dd1a7218c