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
Windows+Composer install fails due to "path too long" #129
Comments
The workaround here is to use the "--prefer-source" install option. However, it is a tedious option, since you cannot tell composer to just apply it to pdepend only. Thus, using it will force clones of all the other dependencies rather than reading them from cache. |
As an aside, I see this issue on phpmd as well. |
Actually, "--prefer-source" is not succeeding as a workaround. When the clone tries to check out the given tag, the long pathing seems to prevent the file creation, thus the checkout fails. |
Hmmm, not sure how to handle this issue |
Right, I couldn't think of anything clever either ;-) I mainly wanted to make it known, since it took some digging for me to figure out why it was failing, as the composer error didn't explain the actual failure point. |
I should at least add a note to the README.md (okay I should add a READMD.md :-] ) and I should put a note in PDepend's documentation. |
Its possible to use .gitattributes to skip the tests folders for Composer ZIP Archives |
Jup it's me :) Thanks for cross-linking. I can confirm there is still a problem, didn't knew about that limitation of ZipArchive, I think on Windows the limit is much larger nowadays. Ref: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - Perhaps this is worth to report upstream to ZipArchive? |
Hey @manuelpichler , can you add this fix to PHPMD also? |
Hi Guys, the answer is generally to move the related project folder (where it happens) upper (or even direcl to the root of the drive). The only problem is that Composer fails & the error message (on ZipArchive) gives no clue about the cause. |
A handfull of the test files with long class names will cause the ZipArchive::extractTo() method to fail, due to the Windows zip file reader saying "Path too long".
This seems to be due to the combination of the long filenames and pathing, on top of the long zip filename being set by either Composer or Github on the download step (I cannot tell which it is), e.g. "6fcfb7666c95f341b42f02c94a47b3a51ed484e0.zip".
The resulting total paths look like this example:
C:\Users\cburgess\AppData\Local\Composer\files\pdepend\pdepend\6fcfb7666c95f341b42f02c94a47b3a51ed484e0\pdepend-pdepend-6fcfb76\src\test\resources\files\Code\ASTMemberPrimaryPrefix\testGraphDereferencedArrayFromStaticMethodCallAndMultipleMethodInvocations.php
It is simply pdepend-1.1.1 that my composer install step is trying to download and install, but the unzip step just can't succeed because of the some of the paths that Windows cannot unzip successfully ("path too long").
I realize it's probably not feasible for you to shorten your class names and path structure. However, no amount of searches I've done leads to anything close to mentioning this issue, so I wanted to make a record of it that people will be able to find.
The text was updated successfully, but these errors were encountered: