[GHC] #10822: GHC inconsistently handles \\?\ for long paths on Windows
GHC
ghc-devs at haskell.org
Tue Sep 1 06:42:00 UTC 2015
#10822: GHC inconsistently handles \\?\ for long paths on Windows
-------------------------------------+-------------------------------------
Reporter: snoyberg | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.2
Keywords: | Operating System: Windows
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
To demonstrate what I mean first:
{{{
>ghc-pkg init \\?\c:\Users\michael\Desktop\some-pkg-db
>dir \\?\c:\Users\Michael\Desktop\some-pkg-db
Volume in drive \\?\c: is Windows8_OS
Volume Serial Number is CEF7-874D
Directory of \\?\c:\Users\Michael\Desktop\some-pkg-db
09/01/2015 09:38 AM <DIR> .
09/01/2015 09:38 AM <DIR> ..
09/01/2015 09:38 AM 40 package.cache
1 File(s) 40 bytes
2 Dir(s) 5,907,509,248 bytes free
>ghc -package-db \\?\c:\Users\Michael\Desktop\some-pkg-db
ghc: can't find a package database at \\?\c:\Users\Michael\Desktop\some-
pkg-db
}}}
The problem: on Windows by default, paths are limited to 260 characters,
which can become a real problem in practice when dealing with the standard
library path hierarchy the Cabal library uses and any package with a
decent name length. This was a real problem in practice, see:
https://github.com/haskell/cabal/issues/2502
Windows has a workaround for this: you can prefix an absolute path with
\\?\, see:
https://msdn.microsoft.com/en-
us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath
It would be very useful if such paths worked with GHC, but currently they
do not. I don't yet know how deep the problem is.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10822>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list