Skip to content

Paket exe can't handle paths that are longer than 260 characters. #949

Closed

Description

@baronfel

Between version 1.19.6 and 1.19.7 Paket became unable to handle paths longer than 260 characters. any paket operation, whether via command line or VS integration, blows up with a PathTooLongException now in a solution we have that is a web app, and so has very long nested node_modules directories.

Activity

  1. baronfel commented on Jul 31, 2015

    @baronfel
    ContributorAuthor

    Detailed stack trace:

    Paket failed with: 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. StackTrace: at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) at System.IO.Path.GetDirectoryName(String path) at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array)
    at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di)
    at Microsoft.FSharp.Collections.ArrayModule.Collect[T,TResult](FSharpFunc2 mapping, T[] array) at <StartupCode$Paket-Core>.$ProjectFile.search@55-2(String pattern, DirectoryInfo di) at Paket.ProjectFile.FindAllProjects(String folder) at Paket.InstallProcess.findAllReferencesFiles(String root) at Paket.UpdateProcess.SmartInstall(String dependenciesFileName, Boolean updateAll, FSharpOption1 exclude, UpdaterOptions options)
    at <StartupCode$Paket-Core>.$PublicAPI.Install@156.Invoke(Unit unitVar0)
    at Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc2 action) at Paket.Program.handler@280-10.Invoke(ArgParseResults1 results)
    at Paket.Program.processWithValidation[T](FSharpFunc2 validateF, FSharpFunc2 commandF, Command command, String[] args)
    at Paket.Program.processCommand@71-1.Invoke(Command command, String[] args)
    at Paket.Program.main()`

  2. forki commented on Jul 31, 2015

    @forki
    Member
  3. baronfel commented on Jul 31, 2015

    @baronfel
    ContributorAuthor

    we could try adding support for the \\?\<FILEPATH> syntax, which opts-in to long path support in win32: http://blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx

  4. ChrisMcKee commented on Jul 31, 2015

    @ChrisMcKee

    +1 When it does find all refs is it scanning all the folders? Just wondering as I have a 'master' folder in my repo which isnt part of the solution, in there is some frontend crap for gulp that handles live reload etc; It's only the npm folder in here that exceeds the win limit (mostly caused by lodash dependencies). But I wouldn't expect Paket to be looking at anything thats not in SLN/CSProj

  5. forki commented on Jul 31, 2015

    @forki
    Member

    could you please check if 1.22.0-alpha005 fixes it?
    you can use paket.bootstrapper.exe prerelease to get that version

  6. baronfel commented on Jul 31, 2015

    @baronfel
    ContributorAuthor

    it does fix the issue for me. Thanks for the quick turnaround, @forki.

  7. forki commented on Jul 31, 2015

    @forki
    Member

    ok cool. will release a proper version.

  8. forki commented on Jul 31, 2015

    @forki
    Member
  9. ChrisMcKee commented on Jul 31, 2015

    @ChrisMcKee

    Yup that wins :) Thanks

  10. baronfel commented on Jul 31, 2015

    @baronfel
    ContributorAuthor

    can you also push an update of Paket.VisualStudio to contain this fix? It's a bit of heartburn for us without it.

  11. forki commented on Jul 31, 2015

    @forki
    Member

    Already done
    On Jul 31, 2015 20:32, "Chester Husk III" notifications@github.com wrote:

    can you also push an update of Paket.VisualStudio to contain this fix?
    It's a bit of heartburn for us without it.

    —
    Reply to this email directly or view it on GitHub
    #949 (comment).

  12. bhugot commented on Mar 17, 2017

    @bhugot
    Contributor

    Hi,

    I still get the issue especially with the new core libs which have really long name like
    runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl

  13. AndyBehr commented on Jul 14, 2017

    @AndyBehr

    The PathTooLong Exception is still happening
    Paket failed with: -> 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.

    What broke it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions