Patchwork [bitbake-devel,1/4] bitbake: runqueue/bitbake-worker: Fix dry run fakeroot issues

mail settings
Submitter Robert Yang
Date Dec. 25, 2013, 2:19 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/63725/
State New
Headers show


Robert Yang - Dec. 25, 2013, 2:19 a.m.
From: Richard Purdie <>

When using the dry run option (-n), bitbake would still try and fire
a specific fakeroot worker. This is doomed to failure since it might
well not have been built.

Add in some checks to prevent the failures.

[YOCTO #5367]

(Bitbake master rev: f34d0606f87ce9dacadeb78bac35879b74f10559)

Signed-off-by: Richard Purdie <>
Signed-off-by: Robert Yang <>
 bitbake/bin/bitbake-worker |    3 ++-
 bitbake/lib/bb/ |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 66b6aab..ff20c1c 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -97,7 +97,8 @@  def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, quieterror
         except TypeError:
              umask = taskdep['umask'][taskname]
-    if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']:
+    # We can't use the fakeroot environment in a dry run as it possibly hasn't been built
+    if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not cfg.dry_run:
         envvars = (workerdata["fakerootenv"][fn] or "").split()
         for key, value in (var.split('=') for var in envvars):
             envbackup[key] = os.environ.get(key)
diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 72c0208..a320a64 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -1408,7 +1408,7 @@  class RunQueueExecuteTasks(RunQueueExecute):
       , self.cfgData)
             taskdep = self.rqdata.dataCache.task_deps[fn]
-            if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']:
+            if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
                 if not self.rq.fakeworker:
                 self.rq.fakeworker.stdin.write("<runtask>" + pickle.dumps((fn, task, taskname, False, self.cooker.collection.get_file_appends(fn))) + "</runtask>")