mirror of
https://git.yoctoproject.org/poky
synced 2026-04-28 06:32:34 +02:00
base.bbclass: clean up dead symlink when handling hosttools
When some hosttool is a dead symlink, bitbake any recipe will fail with error like below. FileExistsError: [Errno 17] File exists: '/usr/bin/chrpath' -> '/path/to/builddir/tmp-glibc/hosttools/chrpath' So we remove dead symlink under hostools/ directory to avoid such error. (From OE-Core rev: b03577cf85784fc052b89083054d911816f8c6e1) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -127,6 +127,9 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
|
||||
for tool in tools:
|
||||
desttool = os.path.join(dest, tool)
|
||||
if not os.path.exists(desttool):
|
||||
# clean up dead symlink
|
||||
if os.path.islink(desttool):
|
||||
os.unlink(desttool)
|
||||
srctool = bb.utils.which(path, tool, executable=True)
|
||||
# gcc/g++ may link to ccache on some hosts, e.g.,
|
||||
# /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)
|
||||
|
||||
Reference in New Issue
Block a user