Path too long Exception when including Git Projects
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Description
Currently we have a Shared Project in our own Git System. We wanted to include it with Paket with the Syntax "git path-to-the-repository". This works so far also fine. Then we wanted to run the build script automatically - no Problem with paket. But: Then we faced, that the build fails because of a "Path too long" exception. The Reason: The Repository has a long structure, for example:
The root Project is in
C:\Projects\MyRepository\src\paket.dependencies
There we specify a Repository like following:
Group SharedProject #Needed for only restoring this, because the project has no known name for update
git ssh://git@my.own.gitsystem.com:5001/ProjectName/MySharedRepository.git
Then what happens is while Restoring:
Paket creates the structure as following:
C:\Projects\MyRepository\src\paket-files\SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository
Inside this repository we have the same structure. So we have something like this inside:
C:\Projects\MyRepository\src\paket-files\SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository\src\paket.dependencies
C:\Projects\MyRepository\src\paket-files\SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository\build.ps1
When executing the build script, the packages will be restored in the following folder:
C:\Projects\MyRepository\src\paket-files\SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository\src\packages\System.Runtime.CompilerServices.Unsafe\system.runtime.compilerservices.unsafe.4.5.2.nupkg
(As an example).
When paket tries to extract we get the following Exception then:
Something went wrong while downloading System.Runtime.CompilerServices.Unsafe 4.5.2
Message: Error during extraction of C:\Projects\MyRepository\src\paket-files\SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository\src\packages\System.Runtime.CompilerServices.Unsafe\system.runtime.compilerservices.unsafe.4.5.2.nupkg.
rying again
-> 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.
My Question: Is there any Workaround for this? Is it for example possible to give the GIT Repository an Alias, so that it won't bloat all the folders (SharedProject\my_own_gitsystemcom5001\ProjectName\MySharedRepository) in between?
Actually we are also using only full .net. so we can't use storage:none.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named. Start by reproducing the Windows PathTooLongException with the nested Git dependency and inspect how Paket constructs the paket-files path and extracts the package; done means the dependency can be restored without exceeding Windows path limits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp, git
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100