Skip to content

Drop GHC < 8.2 #175

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

Merged
merged 2 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,16 @@ defaults:
shell: bash

jobs:
build-old:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
ghc: ['7.8.4', '7.6.3', '7.4.2']
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.4
name: Cache cabal stuff
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}
- name: Install GHC
run: |
sudo add-apt-repository ppa:hvr/ghc -y
sudo apt-get update
sudo apt-get install ghc-${{ matrix.ghc }}
- name: Build
run: |
autoreconf -i
cabal sdist -z -o .
cabal get unix-*.tar.gz
cd unix-*/
cabal update
cabal test -w /opt/ghc/bin/ghc-${{ matrix.ghc }} all
- name: Haddock
run: cabal haddock -w /opt/ghc/bin/ghc-${{ matrix.ghc }}

build:
needs: build-old
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macOS-latest]
ghc: ['8.10', '8.8', '8.6', '8.4', '8.2', '8.0', '7.10']
ghc: ['9.0', '8.10', '8.8', '8.6', '8.4', '8.2']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: haskell/actions/setup@v1
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/ByteString/FilePath.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Directory.hsc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE NondecreasingIndentation #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Directory/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE NondecreasingIndentation #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Directory/Common.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/DynamicLinker.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.DynamicLinker
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/DynamicLinker/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/DynamicLinker/Common.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.DynamicLinker.Common
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/DynamicLinker/Module.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.DynamicLinker.Module
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/DynamicLinker/Module/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
3 changes: 0 additions & 3 deletions System/Posix/DynamicLinker/Prim.hsc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{-# LANGUAGE Trustworthy #-}
#if __GLASGOW_HASKELL__ >= 709
{-# OPTIONS_GHC -fno-warn-trustworthy-safe #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
15 changes: 0 additions & 15 deletions System/Posix/Env.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Env
Expand Down Expand Up @@ -42,12 +38,6 @@ import Control.Monad
import Data.Maybe (fromMaybe)
import System.Posix.Internals

#if !MIN_VERSION_base(4,7,0)
-- needed for backported local 'newFilePath' binding in 'putEnv'
import GHC.IO.Encoding (getFileSystemEncoding)
import qualified GHC.Foreign as GHC (newCString)
#endif

-- |'getEnv' looks up a variable in the environment.

getEnv ::
Expand Down Expand Up @@ -150,11 +140,6 @@ putEnv keyvalue = do s <- newFilePath keyvalue
-- According to SUSv2, the string passed to putenv
-- becomes part of the environment. #7342
throwErrnoIfMinus1_ "putenv" (c_putenv s)
#if !MIN_VERSION_base(4,7,0)
where
newFilePath :: FilePath -> IO CString
newFilePath fp = getFileSystemEncoding >>= \enc -> GHC.newCString enc fp
#endif

foreign import ccall unsafe "putenv"
c_putenv :: CString -> IO CInt
Expand Down
5 changes: 1 addition & 4 deletions System/Posix/Env/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE Trustworthy #-}
#if __GLASGOW_HASKELL__ >= 709
{-# OPTIONS_GHC -fno-warn-trustworthy-safe #-}
#endif
{-# LANGUAGE Safe #-}

-----------------------------------------------------------------------------
-- |
Expand Down
5 changes: 0 additions & 5 deletions System/Posix/Error.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Error
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Fcntl.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Fcntl
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Files.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
{-# LANGUAGE CApiFFI #-}

-----------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Files/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
{-# LANGUAGE CApiFFI #-}

-----------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/IO.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.IO
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/IO/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.IO.ByteString
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/IO/Common.hsc
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE RecordWildCards #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Process.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Process
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Process/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif

-----------------------------------------------------------------------------
-- |
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Resource.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Resource
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Semaphore.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Semaphore
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/SharedMem.hsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.SharedMem
Expand Down
13 changes: 0 additions & 13 deletions System/Posix/Signals.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -680,18 +680,6 @@ awaitSignal maybe_sigset = do
foreign import ccall unsafe "sigsuspend"
c_sigsuspend :: Ptr CSigset -> IO CInt

#if defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706
-- see http://ghc.haskell.org/trac/ghc/ticket/7359#comment:3
-- To be removed when support for GHC 7.4.x is dropped
foreign import ccall unsafe "__hscore_sigdelset"
c_sigdelset :: Ptr CSigset -> CInt -> IO CInt

foreign import ccall unsafe "__hscore_sigfillset"
c_sigfillset :: Ptr CSigset -> IO CInt

foreign import ccall unsafe "__hscore_sigismember"
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
#else
foreign import capi unsafe "signal.h sigdelset"
c_sigdelset :: Ptr CSigset -> CInt -> IO CInt

Expand All @@ -700,7 +688,6 @@ foreign import capi unsafe "signal.h sigfillset"

foreign import capi unsafe "signal.h sigismember"
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
#endif

foreign import ccall unsafe "sigpending"
c_sigpending :: Ptr CSigset -> IO CInt
4 changes: 0 additions & 4 deletions System/Posix/Temp.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Temp
Expand Down
4 changes: 0 additions & 4 deletions System/Posix/Temp/ByteString.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Temp.ByteString
Expand Down
19 changes: 0 additions & 19 deletions System/Posix/Terminal.hsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Terminal
Expand Down Expand Up @@ -134,14 +130,8 @@ getSlaveTerminalName (Fd fd) = do
s <- throwErrnoIfNull "getSlaveTerminalName" (c_ptsname fd)
peekFilePath s

# if __GLASGOW_HASKELL__ < 800
-- see comment in cbits/HsUnix.c
foreign import ccall unsafe "__hsunix_ptsname"
c_ptsname :: CInt -> IO CString
# else
foreign import capi unsafe "HsUnix.h ptsname"
c_ptsname :: CInt -> IO CString
# endif
#else
getSlaveTerminalName _ =
ioError (errnoToIOError "getSlaveTerminalName" eNOSYS Nothing Nothing)
Expand Down Expand Up @@ -194,20 +184,11 @@ foreign import ccall unsafe "__hsunix_push_module"
c_push_module :: CInt -> CString -> IO CInt

#ifdef HAVE_PTSNAME
# if __GLASGOW_HASKELL__ < 800
-- see comment in cbits/HsUnix.c
foreign import ccall unsafe "__hsunix_grantpt"
c_grantpt :: CInt -> IO CInt

foreign import ccall unsafe "__hsunix_unlockpt"
c_unlockpt :: CInt -> IO CInt
# else
foreign import capi unsafe "HsUnix.h grantpt"
c_grantpt :: CInt -> IO CInt

foreign import capi unsafe "HsUnix.h unlockpt"
c_unlockpt :: CInt -> IO CInt
# endif
#else
c_grantpt :: CInt -> IO CInt
c_grantpt _ = return (fromIntegral 0)
Expand Down
Loading