From ead0ff22104f15838dced0eee402449ef3ca58c5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 25 Apr 2024 16:59:09 +0100 Subject: bitbake: build: Handle conflict between cwd and cleandirs If the cwd of the task is also a cleandirs, you would see warnings from bitbake about being unable to obtain cwd during the task execution. Tweak the code to detect this and avoid the warnings. (Bitbake rev: 6c7fd60c10955b0f23f64b25b5b4e154eb22a8f8) Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 44d08f5c55..ab8bce3d57 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -197,6 +197,8 @@ def exec_func(func, d, dirs = None): for cdir in d.expand(cleandirs).split(): bb.utils.remove(cdir, True) bb.utils.mkdirhier(cdir) + if cdir == oldcwd: + os.chdir(cdir) if flags and dirs is None: dirs = flags.get('dirs') -- cgit v1.2.3-54-g00ecf