]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
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:51:27 +0000 (08:51 +0100)
commit67a7b8b021badc17d8fdf447c250e79d291e75f7
treec4d187b2679b0e8ba7c1e1a5aeea0b19b7288973
parent42d727743fa599e0a3c5ad2c29a1e6ede1a918bb
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 ]

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