]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
bitbake: build: don't use $B as the default cwd for functions
authorRoss Burton <ross.burton@intel.com>
Thu, 14 Jul 2016 18:56:22 +0000 (19:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Jul 2016 07:56:50 +0000 (08:56 +0100)
commit2afcbfef2cd1ca568e5225884a8021df38ee3db0
treea56018978d6d52733d23d2b88e8d4a8c761b2cb7
parentfaa726824dfb5bc0141919bb16c0d0069a3da69e
bitbake: build: don't use $B as the default cwd for functions

When bitbake executes a shell or Python function it can cd/chdir() into a
directory before executing the task. If no directory is specified then the
default of $B is used.  However $B is an OpenEmbedded variable and BitBake
shouldn't be aware of it.

To solve this change the semantics slightly so that if no directory is
specified, the current working directory isn't changed.  There's also a sanity
check that emits a warning if a Python task does os.chdir() without restoring
the old path, and the previous working directory is restored.

This does change semantics: whereas before a function in OE would have $B as the
working directory unless specified, now the working directory is the top of the
build tree.  Any breakage this causes can be solved by either adding
do_some_task[dirs] = "${B}" or by using absolute paths in the task.

[ YOCTO #4634 ]

(Bitbake rev: 67a7b8b021badc17d8fdf447c250e79d291e75f7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/build.py