diff options
| author | Devendra Tewari <devendra.tewari@gmail.com> | 2021-04-19 11:23:58 -0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-06 11:16:23 +0100 |
| commit | b71375304f393db62e0894af66e9a60bb9a5c8cc (patch) | |
| tree | ac14a351c1c6cd0ba2679c18a4de92c71dee0e7f /meta/classes/sstate.bbclass | |
| parent | 974441aeda1a2e601865743e945e0332c115ef76 (diff) | |
| download | poky-b71375304f393db62e0894af66e9a60bb9a5c8cc.tar.gz | |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
| -rw-r--r-- | meta/classes/sstate.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 8e8efd18d5..b1c608dcb1 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
| @@ -401,7 +401,7 @@ def sstate_installpkgdir(ss, d): | |||
| 401 | 401 | ||
| 402 | for state in ss['dirs']: | 402 | for state in ss['dirs']: |
| 403 | prepdir(state[1]) | 403 | prepdir(state[1]) |
| 404 | os.rename(sstateinst + state[0], state[1]) | 404 | bb.utils.rename(sstateinst + state[0], state[1]) |
| 405 | sstate_install(ss, d) | 405 | sstate_install(ss, d) |
| 406 | 406 | ||
| 407 | for plain in ss['plaindirs']: | 407 | for plain in ss['plaindirs']: |
| @@ -413,7 +413,7 @@ def sstate_installpkgdir(ss, d): | |||
| 413 | dest = plain | 413 | dest = plain |
| 414 | bb.utils.mkdirhier(src) | 414 | bb.utils.mkdirhier(src) |
| 415 | prepdir(dest) | 415 | prepdir(dest) |
| 416 | os.rename(src, dest) | 416 | bb.utils.rename(src, dest) |
| 417 | 417 | ||
| 418 | return True | 418 | return True |
| 419 | 419 | ||
| @@ -664,7 +664,7 @@ def sstate_package(ss, d): | |||
| 664 | continue | 664 | continue |
| 665 | bb.error("sstate found an absolute path symlink %s pointing at %s. Please replace this with a relative link." % (srcpath, link)) | 665 | bb.error("sstate found an absolute path symlink %s pointing at %s. Please replace this with a relative link." % (srcpath, link)) |
| 666 | bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0])) | 666 | bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0])) |
| 667 | os.rename(state[1], sstatebuild + state[0]) | 667 | bb.utils.rename(state[1], sstatebuild + state[0]) |
| 668 | 668 | ||
| 669 | workdir = d.getVar('WORKDIR') | 669 | workdir = d.getVar('WORKDIR') |
| 670 | sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared") | 670 | sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared") |
| @@ -674,7 +674,7 @@ def sstate_package(ss, d): | |||
| 674 | pdir = plain.replace(sharedworkdir, sstatebuild) | 674 | pdir = plain.replace(sharedworkdir, sstatebuild) |
| 675 | bb.utils.mkdirhier(plain) | 675 | bb.utils.mkdirhier(plain) |
| 676 | bb.utils.mkdirhier(pdir) | 676 | bb.utils.mkdirhier(pdir) |
| 677 | os.rename(plain, pdir) | 677 | bb.utils.rename(plain, pdir) |
| 678 | 678 | ||
| 679 | d.setVar('SSTATE_BUILDDIR', sstatebuild) | 679 | d.setVar('SSTATE_BUILDDIR', sstatebuild) |
| 680 | d.setVar('SSTATE_INSTDIR', sstatebuild) | 680 | d.setVar('SSTATE_INSTDIR', sstatebuild) |
