Skip to content

Commit 445a203

Browse files
committed
Change to only convert file symlinks to hardlinks (directories were causing issues)
1 parent 189ae6b commit 445a203

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • build_tools/packaging/python/templates/rocm/src/rocm_sdk

build_tools/packaging/python/templates/rocm/src/rocm_sdk/_devel.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _clean_dir(dir: Path):
196196
# size (empty)
197197
record_file.write(f"{ti.name},,\n")
198198
if ti.issym():
199-
# Convert symlinks into hardlinks on all platforms.
199+
# Convert file symlinks into hardlinks on all platforms.
200200
# This saves disk space while improving compatibility.
201201
# On Windows: symlinks require admin privileges.
202202
# On Linux: native binaries that use readlink(/proc/self/exe)
@@ -208,7 +208,12 @@ def _clean_dir(dir: Path):
208208
parent_path.mkdir(parents=True, exist_ok=True)
209209
symlink_target = ti.linkname
210210
hardlink_target = dest_path.parent / symlink_target
211-
dest_path.hardlink_to(hardlink_target)
211+
# Only create hardlinks for files, not directories
212+
if hardlink_target.is_file():
213+
dest_path.hardlink_to(hardlink_target)
214+
else:
215+
# For directory symlinks, extract as normal
216+
tf.extract(ti, path=site_lib_path)
212217
else:
213218
tf.extract(ti, path=site_lib_path)
214219
elif ti.isdir():

0 commit comments

Comments
 (0)