From 656a65b2b84e7d529b89cf5de7eb838f902d84a2 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] Signed-off-by: Richard Purdie --- meta/classes/package.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/classes/package.bbclass') diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index e3f0a7060b..cf30f33f3d 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1049,7 +1049,7 @@ python fixup_perms () { # Create path to move directory to, move it, and then setup the symlink bb.utils.mkdirhier(os.path.dirname(target)) #bb.note("Fixup Perms: Rename %s -> %s" % (dir, ptarget)) - os.rename(origin, target) + bb.utils.rename(origin, target) #bb.note("Fixup Perms: Link %s -> %s" % (dir, link)) os.symlink(link, origin) @@ -1967,7 +1967,7 @@ python package_do_shlibs() { for (old, new) in renames: bb.note("Renaming %s to %s" % (old, new)) - os.rename(old, new) + bb.utils.rename(old, new) pkgfiles[pkg].remove(old) shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") -- cgit 1.2.3-korg