From 6a93fec20d906b494be55659a513ddb768fb2ecc Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 10 Dec 2020 13:32:09 +0200 Subject: [PATCH] build script: do not create symlink to symlink, copy it instead --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 116071a6..21c28985 100755 --- a/build.py +++ b/build.py @@ -1164,7 +1164,10 @@ class Builder(object): os.makedirs(dst_subpath, exist_ok=True) Builder.symlink_directory(entry.path, dst_subpath, cleanup=False) elif not os.path.exists(dst_subpath): - os.symlink(entry.path, dst_subpath) + if os.path.islink(entry.path): + shutil.copy(entry.path, dst_subpath, follow_symlinks=False) + else: + os.symlink(entry.path, dst_subpath) def _detect_target(self): for name, target in self.targets.items():