How can I deal with cabal sandbox build errors on Windows due to path length restrictions?

For a while, I was puzzled by the fact that cabal sandbox install / build failed frequently on my Windows machine. I eventually figured out that the errors were being caused by certain paths exceeding the limit MAX_PATH

(paths are effectively limited to 255 characters).

As a concrete example, if I try cabal install data-default-instances-old-locale-0.0.1

in the cabal sandbox folder, it fails. At some point in the process, Cabal calls a ar.exe

path that looks like dist/dist-sandbox-72eb259b\build\libHSdata-default-instances-old-locale-0.0.1-6jcjjaR25tK4x3nJhHHjFM.a-45644\libHSdata-default-instances-old-locale-0.0.1-6jcjjaR25tK4x3nJhHHjFM.a

. This is for the working folder in the temp directory (which I just installed C:\Temp

), so the full path works C:\Temp\data-default-instances-old-locale-0.0.1-18744\data-default-instances-old-locale-0.0.1\dist\dist-sandbox-72eb259b\build\libHSdata-default-instances-old-locale-0.0.1-6jcjjaR25tK4x3nJhHHjFM.a-18744\libHSdata-default-instances-old-locale-0.0.1-6jcjjaR25tK4x3nJhHHjFM.a

.

This final path is 272 characters long, well over the 255 limit.

Longer paths can be dealt with on Windows, but this is not trivial and anyway ar doesn't seem to do everything it takes to handle them (no surprise since it's just a port of the GNU tool chain).

I have a feeling that the situation is in the foreseeable future, maybe someone can think about work?

+3


source to share


1 answer


This has been fixed in the latest cabal-install release. Modernization should solve the problem.



+3


source







All Articles