Add new use_canonical_path option in rezconfig.py #1543
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
It's because on windows, we can map some drive letter, to UNC network path.
To centralize packages but also software binaries.
Problem:
Some softwares like substance, vscode or RV, cannot be run on UNC path and will crash or freeze.
Solution:
Map a new drive letter on windows, using
new-smbmapping
for example, to avoid usage of unc path in PATH environment variable.But, rez resolution plugin, use os.path.realpath directly in
__init__
because of that, the path is converted back from our mapped drive letter to full unc path, so some binaries cannot be launched anymore.Another solution, can be the usage of rez cache, but i found this solution not efficient rather than just execution of binary from network.
Final details:
It's why, i have created a new parameter in the rezconfig, to have an option to bypass the convertion of canonical path on resolution process, in case of mapped letter drive in packages_paths.
Obviously, by default i have set it to True, to not alterate the current behavior of rez resolution plugin.
Test:
use_canonical_path
to False in the rezconfig.py to test and here the result i got:And now vscode can be launched using
rez env vscode -- code --disable-chromium-sandbox
Issue:
Also linked to this discussion