From b71375304f393db62e0894af66e9a60bb9a5c8cc Mon Sep 17 00:00:00 2001 From: Devendra Tewari Date: Mon, 19 Apr 2021 11:23:58 -0300 Subject: classes/lib/scripts: Use bb.utils.rename() instead of os.rename() Incremental build in Docker fails with: OSError: [Errno 18] Invalid cross-device link when source and destination are on different overlay filesystems. Rather than adding fallback code to every call site, use a new wrapper in bitbake which detects this case and falls back to shutil.move which is slower but will handtle the overlay docker filesystems correctly. [YOCTO #14301] (From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2) Signed-off-by: Richard Purdie --- meta/classes/populate_sdk_ext.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/classes/populate_sdk_ext.bbclass') diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index 84232ed9f5..fe840d9cfb 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -165,7 +165,7 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath): shutil.rmtree(temp_sdkbasepath) except FileNotFoundError: pass - os.rename(sdkbasepath, temp_sdkbasepath) + bb.utils.rename(sdkbasepath, temp_sdkbasepath) cmdprefix = '. %s .; ' % conf_initpath logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt' try: @@ -175,7 +175,7 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath): if 'attempted to execute unexpectedly and should have been setscened' in e.stdout: msg += '\n----------\n\nNOTE: "attempted to execute unexpectedly and should have been setscened" errors indicate this may be caused by missing sstate artifacts that were likely produced in earlier builds, but have been subsequently deleted for some reason.\n' bb.fatal(msg) - os.rename(temp_sdkbasepath, sdkbasepath) + bb.utils.rename(temp_sdkbasepath, sdkbasepath) # Clean out residue of running bitbake, which check_sstate_task_list() # will effectively do clean_esdk_builddir(d, sdkbasepath) -- cgit v1.2.3-54-g00ecf