Skip to content

Commit

Permalink
Add symlink locking for filesystems that do not support hardlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
cfxegbert committed Apr 4, 2024
1 parent d5c8643 commit 2a85f70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/rezplugins/package_repository/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class FileSystemPackageRepository(PackageRepository):
"""
schema_dict = {"file_lock_timeout": int,
"file_lock_dir": Or(None, str),
"file_lock_type": Or("default", "link", "mkdir"),
"file_lock_type": Or("default", "link", "mkdir", "symlink"),
"package_filenames": [str]}

building_prefix = ".building"
Expand Down Expand Up @@ -973,6 +973,8 @@ def _lock_package(self, package_name, package_version=None):
from rez.vendor.lockfile.mkdirlockfile import MkdirLockFile as LockFile
elif _settings.file_lock_type == 'link':
from rez.vendor.lockfile.linklockfile import LinkLockFile as LockFile
elif _settings.file_lock_type == 'symlink':
from rez.vendor.lockfile.symlinklockfile import SymlinkLockFile as LockFile

path = self.location

Expand Down
4 changes: 2 additions & 2 deletions src/rezplugins/package_repository/rezconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
filesystem:
# The mechanism used to create the lockfile. If set to 'default', this will
# use hardlinks if the 'os.link' method is present, otherwise mkdir is used.
# It can also be explicitly set to use only 'hardlink', or only 'mkdir'.
# Valid options are 'default', 'mkdir', or 'hardlink'
# It can also be explicitly set to use only 'link', 'symlink', or only 'mkdir'.
# Valid options are 'default', 'mkdir', 'link', or 'symlink'
file_lock_type: default

# The timeout to use when creating file locks. This is done when a variant is
Expand Down

0 comments on commit 2a85f70

Please sign in to comment.