Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new use_canonical_path option in rezconfig.py #1543

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/rez/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def _parse_env_var(self, value):
"alias_back": OptionalStr,
"package_preprocess_function": OptionalStrOrFunction,
"package_preprocess_mode": PreprocessMode_,
"use_canonical_path": OptionalBool,
"error_on_missing_variant_requires": Bool,
"context_tracking_host": OptionalStr,
"variant_shortlinks_dirname": OptionalStr,
Expand Down
5 changes: 5 additions & 0 deletions src/rez/rezconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@
# - "override": Package's preprocess function completely overrides the global preprocess.
package_preprocess_mode = "override"

# Defines if we want to use canonical path in our context resolution
# This is useful when you want to have a consistent path for your context
# and avoid resolution of mapped drive on Windows.
use_canonical_path = True

###############################################################################
# Context Tracking
###############################################################################
Expand Down
7 changes: 4 additions & 3 deletions src/rezplugins/package_repository/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ def __init__(self, location, resource_pool, disable_memcache=None,
disable_pkg_ignore (bool): If True, .ignore* files have no effect
"""

# ensure that differing case doesn't get interpreted as different repos
# on case-insensitive platforms (eg windows)
location = canonical_path(location, platform_)
if config.use_canonical_path:
# ensure that differing case doesn't get interpreted as different repos
# on case-insensitive platforms (eg windows)
location = canonical_path(location, platform_)

super(FileSystemPackageRepository, self).__init__(location, resource_pool)

Expand Down