diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-22 13:31:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-02 13:03:34 +0000 |
commit | 78ae96e667d3fbb8649fe25eb073e15a99d61cc8 (patch) | |
tree | 7c08d884e007e316c3dcdc0a2de7c8feed801bca | |
parent | 1484905373ad717cedcaef37a0addde034ebdc60 (diff) | |
download | bitbake-78ae96e667d3fbb8649fe25eb073e15a99d61cc8.tar.gz |
runqueue/bitbake-worker: Fix dry run fakeroot issues
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]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bin/bitbake-worker | 3 | ||||
-rw-r--r-- | lib/bb/runqueue.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker index 66b6aabfd..ff20c1ca9 100755 --- a/bin/bitbake-worker +++ b/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/lib/bb/runqueue.py b/lib/bb/runqueue.py index 72c020801..a320a649e 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -1408,7 +1408,7 @@ class RunQueueExecuteTasks(RunQueueExecute): bb.event.fire(startevent, 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.start_fakeworker(self) self.rq.fakeworker.stdin.write("<runtask>" + pickle.dumps((fn, task, taskname, False, self.cooker.collection.get_file_appends(fn))) + "</runtask>") |