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

Eric Kow kowey at darcs.net
Thu May 6 15:14:10 UTC 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100506/aecf34bc/attachment.pgp>


More information about the darcs-users mailing list