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/populate_sdk_ext.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/populate_sdk_ext.bbclass')
-rw-r--r-- | meta/classes/populate_sdk_ext.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
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): | |||
165 | shutil.rmtree(temp_sdkbasepath) | 165 | shutil.rmtree(temp_sdkbasepath) |
166 | except FileNotFoundError: | 166 | except FileNotFoundError: |
167 | pass | 167 | pass |
168 | os.rename(sdkbasepath, temp_sdkbasepath) | 168 | bb.utils.rename(sdkbasepath, temp_sdkbasepath) |
169 | cmdprefix = '. %s .; ' % conf_initpath | 169 | cmdprefix = '. %s .; ' % conf_initpath |
170 | logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt' | 170 | logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt' |
171 | try: | 171 | try: |
@@ -175,7 +175,7 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath): | |||
175 | if 'attempted to execute unexpectedly and should have been setscened' in e.stdout: | 175 | if 'attempted to execute unexpectedly and should have been setscened' in e.stdout: |
176 | 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' | 176 | 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' |
177 | bb.fatal(msg) | 177 | bb.fatal(msg) |
178 | os.rename(temp_sdkbasepath, sdkbasepath) | 178 | bb.utils.rename(temp_sdkbasepath, sdkbasepath) |
179 | # Clean out residue of running bitbake, which check_sstate_task_list() | 179 | # Clean out residue of running bitbake, which check_sstate_task_list() |
180 | # will effectively do | 180 | # will effectively do |
181 | clean_esdk_builddir(d, sdkbasepath) | 181 | clean_esdk_builddir(d, sdkbasepath) |