Skip to content

Commit cc26064

Browse files
committed
Fix rez-pkg-cache to preserve symlinks instead of following them
By default, shutil.copytree follows symlinks which can cause failures when symlink targets are inaccessible. This change adds symlinks=True parameter to preserve symlinks instead of following them, matching the default behavior of rez-cp. Fixes #2047 Signed-off-by: pmady <pavan4devops@gmail.com>
1 parent 9afb325 commit cc26064

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
<!-- start-here-sphinx-start-after -->
44

5+
## Unreleased
6+
7+
### Fixes
8+
- Fix `rez-pkg-cache` to preserve symlinks instead of following them [\#2047](https://github.com/AcademySoftwareFoundation/rez/issues/2047)
9+
510
## v3.3.0 (2025-10-17)
611
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/3.3.0) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/v3.2.1...3.3.0)
712

src/rez/package_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def _while_copying():
405405
th.start()
406406

407407
try:
408-
shutil.copytree(variant_root, rootpath)
408+
shutil.copytree(variant_root, rootpath, symlinks=True)
409409
finally:
410410
still_copying = False
411411

0 commit comments

Comments
 (0)