-
Notifications
You must be signed in to change notification settings - Fork 427
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
Prefix replacement with ripgrep might fail on long paths on Windows #4357
Comments
There's also a more general issue with Windows path lengths. Please see issue ( conda/conda#7203 ). |
Hi there, thank you for your contribution! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment. Thanks! |
This is still an issue today, and can be seen on this PR, which fails to
With this error, now exposed more fully with
Presumably, when found to be on windows, def ensure_extended_length_path(path: Path) -> Path:
"""Get the extended-length version of a path (Windows).
On Windows, by default, the maximum length of a path (MAX_PATH) is 260
characters, and operations on paths longer than that fail. But it is possible
to overcome this by converting the path to "extended-length" form before
performing the operation:
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
On Windows, this function returns the extended-length absolute version of path.
On other platforms it returns path unchanged.
"""
if sys.platform.startswith("win32"):
path = path.resolve()
path = Path(get_extended_length_path_str(str(path)))
return path As there are ... many different ways |
So Might be worth checking if issues that still see this are using a recent version of |
Comes from conda-forge/staged-recipes#17519 (comment)
Actual Behavior
Prefix replacement fails with too long paths on Windows if
ripgrep
is used. The exception is not caught as it should because the subprocess is never launched:Expected Behavior
Long paths should be handled correctly or, if impossible, fallback safely to the Python implementation. Also, right now, this performance trick is either all-in or nothing. There's no logic to accept individual file errors on the ripgrep approach.
Uninstalling
ripgrep
or manglingrg
path disables this code path and makes everything work at a lower performance.Steps to Reproduce
Use this recipe.
Full CI logs: full_log.txt
Output of conda info
The text was updated successfully, but these errors were encountered: