[Hackage] #473: Cabal-1.6 does not work on Windows with ghc-6.6.x

#473: Cabal-1.6 does not work on Windows with ghc-6.6.x
----------------------------------+-----------------------------------------
Reporter: duncan | Owner:
Type: defect | Status: new
Priority: normal | Milestone: Cabal-1.6
Component: Cabal library | Version: 1.6.0.1
Severity: normal | Keywords:
Difficulty: very easy (<1 hour) | Ghcversion: 6.6.1
Platform: Windows |
----------------------------------+-----------------------------------------
http://haskell.org/pipermail/cabal-devel/2009-January/004622.html
The problem is the `writeFileAtomic` function calls the compat version of
`openNewBinaryFile` and that fails on Windows with ghc-6.6. Specifically
it is the `fdToHandle` that throws the exception.
The crux is:
{{{
fd <- withCString filepath $ \ f ->
c_open f oflags 0o666
h <- fdToHandle (fromIntegral fd)
}}}
However `fdToHandle` fails with the exception
{{{
fdGetMode: invalid argument
}}}
This is because in ghc-6.6.x, the `fdToHandle` calls `fdGetMode` and
passes the result to `openFd`:
{{{
fdToHandle :: FD -> IO Handle
fdToHandle fd = do
mode <- fdGetMode fd
let fd_str = "

#473: Cabal-1.6 does not work on Windows with ghc-6.6.x
----------------------------+-----------------------------------------------
Reporter: duncan | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: Cabal-1.6
Component: Cabal library | Version: 1.6.0.1
Severity: normal | Resolution: fixed
Keywords: | Difficulty: very easy (<1 hour)
Ghcversion: 6.6.1 | Platform: Windows
----------------------------+-----------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
{{{
Thu Jan 22 17:21:00 GMT 2009 Duncan Coutts
participants (1)
-
Hackage