Created attachment 3442 [details] Avoid exception when calling os.getcwd() Under some rather unique conditions I encountered the following error: ERROR: nativesdk-libgcc-initial-6.2.0-r0 do_populate_sysroot: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_populate_sysroot(d) 0003: File: '/data/master-zephyr/poky/meta/classes/staging.bbclass', lineno: 213, function: do_populate_sysroot 0209: problems.add(task) 0210: return problems 0211: 0212:python do_populate_sysroot () { *** 0213: bb.build.exec_func("sysroot_stage_all", d) 0214: bb.build.exec_func("sysroot_strip", d) 0215: for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS', True) or '').split(): 0216: bb.build.exec_func(f, d) 0217: pn = d.getVar("PN", True) File: '/data/master-zephyr/poky/bitbake/lib/bb/build.py', lineno: 264, function: exec_func 0260: exec_func_python(func, d, runfile, cwd=adir, pythonexception=pythonexception) 0261: else: 0262: exec_func_shell(func, d, runfile, cwd=adir) 0263: *** 0264: if oldcwd and os.getcwd() != oldcwd: 0265: try: 0266: bb.warn("Task %s changed cwd to %s" % (func, os.getcwd())) 0267: os.chdir(oldcwd) 0268: except: Exception: FileNotFoundError: [Errno 2] No such file or directory The reason for the exception is we are running the command os.getcwd() from a directory that no longer exist. (The attachment fixes this)
patch sent to the mailing list: http://lists.openembedded.org/pipermail/openembedded-core/2016-September/126949.html
Patch merged with master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8b24b0c3593de2d8ada977cd4a49229771a6c477