xeno icon indicating copy to clipboard operation
xeno copied to clipboard

bytestring-mmap doesn't build on GHC 9.6

Open swt2c opened this issue 1 year ago • 1 comments

bytestring-mmap doesn't build on GHC 9.6 and appears to have been abandoned upstream. It is also no longer part of Stackage LTS.

This prevents getting CI running with newer GHC versions, and it's not immediately clear how to resolve it.

2025-04-01T15:40:35.5878980Z bytestring-mmap              > [2 of 3] Compiling System.IO.Posix.MMap
2025-04-01T15:40:35.5980350Z bytestring-mmap              > 
2025-04-01T15:40:35.6002260Z bytestring-mmap              > /private/var/folders/qn/7t0vq3ts721cmgt0tgrtgzl80000gn/T/stack-7687cee8a58ec204/bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs:101:13: error: [GHC-83865]
2025-04-01T15:40:35.6005280Z bytestring-mmap              >     • Couldn't match expected type: OpenFileFlags -> IO Fd
2025-04-01T15:40:35.6063720Z bytestring-mmap              >                   with actual type: IO Fd
2025-04-01T15:40:35.6074930Z bytestring-mmap              >     • The function ‘openFd’ is applied to four value arguments,
2025-04-01T15:40:35.6076900Z bytestring-mmap              >         but its type ‘FilePath -> OpenMode -> OpenFileFlags -> IO Fd’
2025-04-01T15:40:35.6077930Z bytestring-mmap              >         has only three
2025-04-01T15:40:35.6078820Z bytestring-mmap              >       In a stmt of a 'do' block:
2025-04-01T15:40:35.6079710Z bytestring-mmap              >         fd <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6080520Z bytestring-mmap              >       In the expression:
2025-04-01T15:40:35.6081390Z bytestring-mmap              >         do fd <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6082250Z bytestring-mmap              >            always (closeFd fd)
2025-04-01T15:40:35.6083090Z bytestring-mmap              >              $ do stat <- getFdStatus fd
2025-04-01T15:40:35.6083870Z bytestring-mmap              >                   let ...
2025-04-01T15:40:35.6084610Z bytestring-mmap              >                   ....
2025-04-01T15:40:35.6085310Z bytestring-mmap              >     |
2025-04-01T15:40:35.6086110Z bytestring-mmap              > 101 |     fd   <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6086910Z bytestring-mmap              >     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-01T15:40:35.6087700Z bytestring-mmap              > 
2025-04-01T15:40:35.6088780Z bytestring-mmap              > /private/var/folders/qn/7t0vq3ts721cmgt0tgrtgzl80000gn/T/stack-7687cee8a58ec204/bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs:101:31: error: [GHC-83865]
2025-04-01T15:40:35.6089960Z bytestring-mmap              >     • Couldn't match expected type ‘OpenFileFlags’
2025-04-01T15:40:35.6090840Z bytestring-mmap              >                   with actual type ‘Maybe a0’
2025-04-01T15:40:35.6092150Z bytestring-mmap              >     • In the third argument of ‘openFd’, namely ‘Nothing’
2025-04-01T15:40:35.6093000Z bytestring-mmap              >       In a stmt of a 'do' block:
2025-04-01T15:40:35.6093850Z bytestring-mmap              >         fd <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6094650Z bytestring-mmap              >       In the expression:
2025-04-01T15:40:35.6110600Z bytestring-mmap              >         do fd <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6111370Z bytestring-mmap              >            always (closeFd fd)
2025-04-01T15:40:35.6111730Z bytestring-mmap              >              $ do stat <- getFdStatus fd
2025-04-01T15:40:35.6112080Z bytestring-mmap              >                   let ...
2025-04-01T15:40:35.6112400Z bytestring-mmap              >                   ....
2025-04-01T15:40:35.6112660Z bytestring-mmap              >     |
2025-04-01T15:40:35.6113000Z bytestring-mmap              > 101 |     fd   <- openFd f ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6113410Z bytestring-mmap              >     |                               ^^^^^^^
2025-04-01T15:40:35.6113790Z bytestring-mmap              > [3 of 3] Compiling System.IO.Posix.MMap.Lazy
2025-04-01T15:40:35.6114150Z bytestring-mmap              > 
2025-04-01T15:40:35.6114820Z bytestring-mmap              > /private/var/folders/qn/7t0vq3ts721cmgt0tgrtgzl80000gn/T/stack-7687cee8a58ec204/bytestring-mmap-0.2.2/System/IO/Posix/MMap/Lazy.hs:94:13: error: [GHC-83865]
2025-04-01T15:40:35.6115690Z bytestring-mmap              >     • Couldn't match expected type: OpenFileFlags -> IO Fd
2025-04-01T15:40:35.6116090Z bytestring-mmap              >                   with actual type: IO Fd
2025-04-01T15:40:35.6116570Z bytestring-mmap              >     • The function ‘openFd’ is applied to four value arguments,
2025-04-01T15:40:35.6117080Z bytestring-mmap              >         but its type ‘FilePath -> OpenMode -> OpenFileFlags -> IO Fd’
2025-04-01T15:40:35.6117470Z bytestring-mmap              >         has only three
2025-04-01T15:40:35.6118030Z bytestring-mmap              >       In a stmt of a 'do' block:
2025-04-01T15:40:35.6118590Z bytestring-mmap              >         fd <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6118960Z bytestring-mmap              >       In the expression:
2025-04-01T15:40:35.6119350Z bytestring-mmap              >         do fd <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6119850Z bytestring-mmap              >            always (closeFd fd)
2025-04-01T15:40:35.6120220Z bytestring-mmap              >              $ do stat <- getFdStatus fd
2025-04-01T15:40:35.6120580Z bytestring-mmap              >                   let ...
2025-04-01T15:40:35.6122320Z bytestring-mmap              >                   ....
2025-04-01T15:40:35.6122930Z bytestring-mmap              >    |
2025-04-01T15:40:35.6123290Z bytestring-mmap              > 94 |     fd   <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6123900Z bytestring-mmap              >    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-01T15:40:35.6124430Z bytestring-mmap              > 
2025-04-01T15:40:35.6125610Z bytestring-mmap              > /private/var/folders/qn/7t0vq3ts721cmgt0tgrtgzl80000gn/T/stack-7687cee8a58ec204/bytestring-mmap-0.2.2/System/IO/Posix/MMap/Lazy.hs:94:34: error: [GHC-83865]
2025-04-01T15:40:35.6126980Z bytestring-mmap              >     • Couldn't match expected type ‘OpenFileFlags’
2025-04-01T15:40:35.6131530Z bytestring-mmap              >                   with actual type ‘Maybe a0’
2025-04-01T15:40:35.6132000Z bytestring-mmap              >     • In the third argument of ‘openFd’, namely ‘Nothing’
2025-04-01T15:40:35.6132390Z bytestring-mmap              >       In a stmt of a 'do' block:
2025-04-01T15:40:35.6132780Z bytestring-mmap              >         fd <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6133160Z bytestring-mmap              >       In the expression:
2025-04-01T15:40:35.6133770Z bytestring-mmap              >         do fd <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6134180Z bytestring-mmap              >            always (closeFd fd)
2025-04-01T15:40:35.6134730Z bytestring-mmap              >              $ do stat <- getFdStatus fd
2025-04-01T15:40:35.6135070Z bytestring-mmap              >                   let ...
2025-04-01T15:40:35.6135390Z bytestring-mmap              >                   ....
2025-04-01T15:40:35.6135650Z bytestring-mmap              >    |
2025-04-01T15:40:35.6136130Z bytestring-mmap              > 94 |     fd   <- openFd path ReadOnly Nothing defaultFileFlags
2025-04-01T15:40:35.6136520Z bytestring-mmap              >    |                                  ^^^^^^^

swt2c avatar Apr 01 '25 16:04 swt2c

Hey hey, was playing a bit with xeno and found this exact problem when running stack bench with newer versions of ghc. The problem with bytestring-mmap is with the arguments of openFd, I did stack unpack bytestring-mmap and removed the Nothing and compiled again benchmarks again and it worked...

I am not even sure what package depends on it, does bytestring depend on it?

Alf0nso avatar Apr 14 '25 12:04 Alf0nso