Skip to content

Patch for unix-2.7.2.1 causes boot failure with ghc-8.0.2 #43

Open
@dbaynard

Description

I've been getting this error preventing ghcjs from booting, corresponding to the following patch. I've been using stack with lts-8.16 (in a clean docker environment).

System/Posix/IO/Common.hsc:284:1: error:
    parse error (possibly incorrect indentation or mismatched brackets)
cabal: Error: some packages failed to install:
directory-1.3.0.0 depends on unix-2.7.2.1 which failed to install.
ghc-boot-8.0.2 depends on unix-2.7.2.1 which failed to install.
ghci-8.0.2 depends on unix-2.7.2.1 which failed to install.
process-1.4.3.0 depends on unix-2.7.2.1 which failed to install.
unix-2.7.2.1 failed during the building phase. The exception was:
ExitFailure 1
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index a838352..8e7e317 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -281,7 +281,7 @@ mode2Int SeekFromEnd  = (#const SEEK_END)
 -- | May throw an exception if this is an invalid descriptor.
 fdSeek :: Fd -> SeekMode -> FileOffset -> IO FileOffset
 fdSeek (Fd fd) mode off =
-  throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
+  throwErrnoIfMinus1 "fdSeek" (fmap fromIntegral $ Base.c_lseek fd (fromIntegral off) (mode2Int mode))
 
 -- -----------------------------------------------------------------------------
 -- Locking

Going to have a play and see whether I can get it to compile, but I don't really get what's going on here.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions