[darcs-devel] [patch235] Fix compilation on GHC 6.12 on win32 (needs unix-compat).

Eric Kow bugs at darcs.net
Thu May 6 15:14:54 UTC 2010


Eric Kow <kowey at darcs.net> added the comment:

On Thu, May 06, 2010 at 14:25:21 +0000, Petr Ročkai wrote:
> Fixes windows builds on latest Haskell Platform. Should be hopefully applied to
> 2.4 branch as well. (To successfully build, you will also need hashed-storage
> 0.4.13, to be released.)

I talked briefly with Petr on IRC about this.

Aside from accounting for the GHC 6.12 internal representation for file
paths, this replaces our System.Posix.Files compatibility code (for
Windows) with a 3rd party package unix-compat (by Bjorn Bringert).

We agreed that whatever the risks of this action are, the alternative
(doing it ourselves) is worse.  So press on...

No comments, just reading below.

Fix compilation on GHC 6.12 on win32 (needs unix-compat).
---------------------------------------------------------
> +module System.Posix.Files( isNamedPipe, isDirectory, isRegularFile, isSymbolicLink
> +                               , getFdStatus, getFileStatus, getSymbolicLinkStatus
> +                               , modificationTime, setFileMode, fileSize, fileMode
> +                               , stdFileMode, linkCount, createLink ) where

We nuke these and re-export them from System.PosixCompat.Files.

>  openFd :: FilePath -> OpenMode -> Maybe FileMode -> OpenFileFlags -> IO Fd
>  openFd name how maybe_mode off = do
> +#if mingw32_HOST_OS && __GLASGOW_HASKELL__ >= 612
> +  withCWString name $ \s -> do
> +#else
>    withCString name $ \s -> do
> hunk ./src/win32/System/Posix/IO.hsc 45
> +#endif
>     fd <- throwErrnoIfMinus1 "openFd" (c_open s all_flags mode_w)
>     return (Fd fd)
>   where

These are motivated by the recent GHC 6.12 changes pointed out by Brian
Smith on Reddit and discussed with Simon Marlow.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

----------
nosy: +kowey

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch235>
__________________________________


More information about the darcs-devel mailing list