-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip install generates file paths > 260 which break on Windows #11231
Comments
I imagine the pip developers may not be interested in improving the default behavior for Windows because of this option: https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation However I note also that because fastchunking invokes C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe it would appear that the max-path limitation cannot be changed and the install continues to fail even with modification of this registry value. The only way to get |
pip does not have control over |
@uranusjr Should an issue be raised with setuptools then as well? |
Yes please! |
Presumably this isn't just a Windows issue, Unix also has |
POSIX compliant OSes have a Though it should be noted that |
Thanks for the reference (which I haven't read yet, but I will do so at some point). I'll also note as another example of weirdness, that the maximum length of a path is almost certainly filesystem dependent, not OS-dependent. (And the "support long paths" setting on Windows imples that it's might not even be filesystem dependent, but can depend on user configuration as well...) Anyway, my main point is that we should "fix" this issue in a generic way, using whatever means is available to detect the maximum supported path length, and warning based on that, not based on assumptions about the platform. |
So fun fact, |
Hmm, so on Linux we could check Given that I'm a strong -1 on producing a warning on paths over 260 characters for Windows systems with long paths enabled, this feels like it's too hard to get right for too little benefit. I'm willing to be convinced otherwise by a working PR (that doesn't report false positives) though. |
The other thing to consider on Windows is if the thing you are installing is not a wheel, then it needs to be built and that python process may have long paths enabled but -- if that is going to invoke the Visual Studio linker as some things do, then it is going to fail on the < 260 limit. This bit me last night with Cython, unrelated to the OP, and I squeaked past it by setting my env variable for |
Yes, I think this is the point where it likely needs to be handled by setuptools, as they will know the process failed and can potentially report on why. Although of course they may also simply say that it's the linker's issue to give a better error message, as well... As a strawman example, a linker on any platform that failed on paths over 100 characters long, for no better reason than they hard coded path buffers to that length, would behave in basically the same way as we're seeing here. At some point, we have to assume that the tools we're invoking work properly 🤷 The problem is that the further up the chain you go, the worse the risk of mistakenly guessing that it's a "path too long" issue when it isn't. |
Description
NB: This is a cross-bug report with pypa/pipenv#5160. As per @matteius advice I am putting this on pip backlog.
pip can generate file paths during build which are more than 260 characters which breaks on Windows as described in this issue by netleibi/fastchunking#6 (comment) by @netleibi
There are no suitable OS workarounds and therefore I propose that this is a pip bug.
Expected behavior
pip version
22.1.2
Python version
3.9.7
OS
Windows 10
How to Reproduce
pip install fastchunking
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: