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

Support for long names on Windows #4264

Open
kine opened this issue Jul 8, 2024 · 0 comments
Open

Support for long names on Windows #4264

kine opened this issue Jul 8, 2024 · 0 comments

Comments

@kine
Copy link

kine commented Jul 8, 2024

Description

When using Paket together with nuget packages having long IDs or long file names inside it, current version (8.0.3+75b30cdcb8859e8d129f139444d9b9b600bfff07) fails when working with them. Long file names are common in our usage for packing Microsoft Dynamics 365 Business Central extensions files as nuget packages for distribution.

Repro steps

Use "Paket install" to install NuGet package with ID length 100 characters (used in my case) and file inside with length 151 chars (used in my case). Even when used root path as cache and target path, it fails.

Expected behavior

When using windows with LongPath support enabled, paket install should work with packages with long IDs and long file names inside.

Actual behavior

Version 8.0.3 output:

...
Package C:\xxx\XXXXXXXXXXXX\Paket.test\packages\XxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 23.1.8.1.nupkg couldn't be extracted to "C:\xxx\XXXXXXXXXXXX\Paket.test\packages\XxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx". System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.. Trying to extract files individually.
Something went wrong while downloading xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.23.1.8.1.nupkg 
Message: Error during extraction of C:\xxx\XXXXXXXXXXXX\Paket.test\packages\XxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.23.1.8.1.nupkg.
...
Paket failed with
-> Error during extraction of C:\xxx\XXXXXXXXXXXX\Paket.test\packages\XxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.23.1.8.1.nupkg.

    In rare cases a firewall might have blocked the download. Please look into the file and see if it contains text with further information.
-> PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I tried to keep the length same when masking the file name.

Known workarounds

When I cloned the code and upgraded the project to .Net core 8.0 and updated all dependencies, everything worked without problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant