-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Description
unix-2.7.3 as available on hackage, declares that it build-depends on bytestring >=0.9.2, but it fails to build against bytestring-0.9.2.1 (on e.g. GHC 8.2.2):
System/Posix/Env/ByteString.hsc:152:30: error:
• Couldn't match expected type ‘CSize’ with actual type ‘Int’
• In the third argument of ‘memcpy’, namely ‘l’
In a stmt of a 'do' block: memcpy buf (p `plusPtr` o) l
In the expression:
do buf <- mallocBytes (l + 1) /rows
memcpy buf (p `plusPtr` o) l
pokeByteOff buf l (0 :: Word8) cus cells/cols
throwErrnoIfMinus1_ "putenv" (c_putenv (castPtr buf))
|
152 | memcpy buf (p `plusPtr` o) l
| ^ o
Error: [Cabal-7125] f
Failed to build unix-2.7.3.
The reason is that Data.ByteString.Internal.memcpy changed types:
bytestring-0.9.2.1:memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO ()bytestring-0.10.0.0:memcpy :: Ptr Word8 -> Ptr Word8 -> Int -> IO ()
A hackage revision is needed here.
Notably, newer versions of unix also declare dependency on bytestring >=0.9.2, all the way up to git head, although this issue cannot be reproduced for coincidental reasons: unix >2.7.3 requires filepath >=1.4.100, which requires bytestring >=0.11.3.