Skip to content

Commit 47c11d5

Browse files
author
Diptorup Deb
authored
Correctly copy symlinks to the dpctl dir. (#455)
* Correctly copy symlinks to the dpctl dir, but avoid copying if the symlink was previously copied.
1 parent 0f9751a commit 47c11d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/build_backend.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,16 @@ def build_backend(
143143
for file in glob.glob(
144144
os.path.join(dpctl_dir, "install", "lib", "*.so*")
145145
):
146-
shutil.copy(file, os.path.join(dpctl_dir, "dpctl"))
146+
# Check if the file already exists before copying. The check is
147+
# needed when dealing with symlinks.
148+
if not os.path.exists(
149+
os.path.join(dpctl_dir, "dpctl", os.path.basename(file))
150+
):
151+
shutil.copy(
152+
src=file,
153+
dst=os.path.join(dpctl_dir, "dpctl"),
154+
follow_symlinks=False,
155+
)
147156
elif IS_WIN:
148157
if os.path.exists(os.path.join(DPCPP_ROOT, "bin", "dpcpp.exe")):
149158
cmake_compiler_args = [

0 commit comments

Comments
 (0)