generic-poky/bitbake/lib/bb
Ross Burton 2afcbfef2c 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>
2016-07-19 08:56:50 +01:00
..
fetch2 bitbake: fetch2/wget: attempt checkstatus again if it fails 2016-07-08 09:57:26 +01:00
parse bitbake: parse/ast, event: Ensure we reset registered handlers during parsing 2016-06-15 08:35:07 +01:00
pysh bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
server bitbake: xmlrpc: add parameter use_builtin_types 2016-06-02 08:24:04 +01:00
tests bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
ui bitbake: buildinfohelper: ensure task datetimes are timezone-aware 2016-07-08 09:57:28 +01:00
COW.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
__init__.py bitbake: lib/bb: Set required python 3 version to 3.4.0 2016-06-02 08:24:03 +01:00
build.py bitbake: build: don't use $B as the default cwd for functions 2016-07-19 08:56:50 +01:00
cache.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
cache_extra.py bitbake: bitbake: cooker: get extra information from recipe cache 2013-09-22 12:19:44 +01:00
checksum.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
codeparser.py bitbake: codeparser: Use hashlib for hashing, not hash() 2016-06-03 13:48:33 +01:00
command.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
compat.py bitbake: compat/server/utils: Jettison pre python 2.7.3 workarounds 2013-06-14 17:26:30 +01:00
cooker.py bitbake: cooker: clean up EvertWriter 2016-06-20 17:23:57 +01:00
cookerdata.py bitbake: cookerdata: print an error if layer dir does not exist 2016-06-03 13:13:30 +01:00
daemonize.py bitbake: daemonize/prserv/tests/fetch: Convert file() -> open() 2016-05-13 13:41:32 +01:00
data.py bitbake: Implement support for per-task exports 2016-05-19 09:05:20 +01:00
data_smart.py bitbake: data_smart/utils: Add 'd' to the context used for better_eval in python expansion 2016-06-13 12:16:10 +01:00
event.py bitbake: knotty: add code to support showing progress for sstate object querying 2016-07-08 09:57:26 +01:00
exceptions.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
main.py bitbake: knotty: add quiet output mode 2016-07-08 09:57:27 +01:00
methodpool.py bitbake: event/utils/methodpool: Add a cache of compiled code objects 2015-12-22 00:02:05 +00:00
monitordisk.py bitbake: bitbake: Update logger.warn() -> logger.warning() 2016-05-11 10:34:30 +01:00
msg.py bitbake: knotty: add quiet output mode 2016-07-08 09:57:27 +01:00
namedtuple_with_abc.py bitbake: lib/bb/*.py: Typo fixes/grammar/comment fixes, nothing functional. 2014-08-25 08:57:45 +01:00
persist_data.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
process.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
progress.py bitbake: progress: Ensure missing start event is fired 2016-07-08 09:57:27 +01:00
providers.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
runqueue.py bitbake: runqueue: report progress for "Preparing RunQueue" step 2016-07-08 09:57:27 +01:00
shell.py Introduce new param caches_array into Cache impl. 2011-06-07 22:39:52 +01:00
siggen.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
taskdata.py bitbake: taskdata/runqueue: Rewrite without use of ID indirection 2016-06-15 08:35:07 +01:00
tinfoil.py bitbake: tinfoil: remove logging handler at shutdown 2015-09-23 22:44:56 +01:00
utils.py bitbake: lib/bb/utils: fix set_process_name 2016-07-19 08:47:06 +01:00