Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dbaynard opened this issue May 31, 2017 · 0 comments
Open

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

dbaynard opened this issue May 31, 2017 · 0 comments

Comments

@dbaynard
Copy link

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.

@dbaynard dbaynard changed the title Patch for unix-2.7.2.1 fails with ghc-8.0.2 Patch for unix-2.7.2.1 causes build failure with ghc-8.0.2 May 31, 2017
@dbaynard dbaynard changed the title Patch for unix-2.7.2.1 causes build failure with ghc-8.0.2 Patch for unix-2.7.2.1 causes boot failure with ghc-8.0.2 May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant