summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2017-08-18 11:55:44 +0200
committerThomas Hallgren <th-github@altocumulus.org>2017-08-18 11:55:44 +0200
commit0a0eaa01bcbe9574bb86a6470ca5139fbd32a9d3 (patch)
tree6589f7ab9c1abbadf5d054f3c47f5b056e875af8
parent5ab8b7082cbe6039a952b7f8bd31c16f6a5f3375 (diff)
Bump version requirements to base>=4.6, Cabal>=1.20
Cabal>=1.20 allows control over parallelism when compiling grammars from Setup.hs and WebSetup.hs. base>=4.6 allows conditional compilation with CPP to be eliminated from a few modules. base-4.6 corresponds to GHC 7.6.3, which is what you get in Debian 8 (aka jessie, aka oldstable) from 2015.
-rw-r--r--WebSetup.hs7
-rw-r--r--gf.cabal8
-rw-r--r--src/compiler/GF/System/Catch.hs8
-rw-r--r--src/compiler/GF/System/Concurrency.hs10
-rw-r--r--src/runtime/haskell/PGF/Optimize.hs6
5 files changed, 12 insertions, 27 deletions
diff --git a/WebSetup.hs b/WebSetup.hs
index 3e2e0832d..ee9f741d6 100644
--- a/WebSetup.hs
+++ b/WebSetup.hs
@@ -98,14 +98,13 @@ execute command args =
showArg arg = if ' ' `elem` arg then "'" ++ arg ++ "'" else arg
-- | This function is used to enable parallel compilation of the RGL and
--- example grammars, but it is commented out by default
--- to avoid casing problems for developers using Cabal<1.20
+-- example grammars
numJobs flags =
if null n
then ["-j","+RTS","-A20M","-N","-RTS"]
else ["-j="++n,"+RTS","-A20M","-N"++n,"-RTS"]
where
-- buildNumJobs is only available in Cabal>=1.20
- n = {-case buildNumJobs flags of
+ n = case buildNumJobs flags of
Flag mn | mn/=Just 1-> maybe "" show mn
- _ ->-} ""
+ _ -> ""
diff --git a/gf.cabal b/gf.cabal
index 38dc6ddb9..120b11b2f 100644
--- a/gf.cabal
+++ b/gf.cabal
@@ -1,7 +1,7 @@
name: gf
-version: 3.9
+version: 3.9-git
-cabal-version: >= 1.10
+cabal-version: >= 1.20
build-type: Custom
license: OtherLicense
license-file: LICENSE
@@ -57,6 +57,7 @@ flag interrupt
flag server
Description: Include --server mode
Default: True
+
flag network-uri
description: Get Network.URI from the network-uri package
default: True
@@ -68,6 +69,7 @@ flag network-uri
flag custom-binary
Description: Use a customised version of the binary package
Default: True
+ Manual: True
flag c-runtime
Description: Include functionality from the C run-time library (which must be installed already)
@@ -75,7 +77,7 @@ flag c-runtime
Library
default-language: Haskell2010
- build-depends: base >= 4.5 && <5,
+ build-depends: base >= 4.6 && <5,
array,
containers,
bytestring,
diff --git a/src/compiler/GF/System/Catch.hs b/src/compiler/GF/System/Catch.hs
index f69934af5..11fae1a7b 100644
--- a/src/compiler/GF/System/Catch.hs
+++ b/src/compiler/GF/System/Catch.hs
@@ -1,13 +1,7 @@
--- | Isolate backwards incompatible library changes to 'catch' and 'try'
-{-# LANGUAGE CPP #-}
+-- | Backwards compatible 'catch' and 'try'
module GF.System.Catch where
import qualified System.IO.Error as S
-- ** Backwards compatible try and catch
-#if MIN_VERSION_base(4,4,0)
catch = S.catchIOError
try = S.tryIOError
-#else
-catch = S.catch
-try = S.try
-#endif
diff --git a/src/compiler/GF/System/Concurrency.hs b/src/compiler/GF/System/Concurrency.hs
index 41f318c7a..514eab649 100644
--- a/src/compiler/GF/System/Concurrency.hs
+++ b/src/compiler/GF/System/Concurrency.hs
@@ -1,7 +1,6 @@
-{-# LANGUAGE CPP,ForeignFunctionInterface #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
-- | A variant of 'Control.Concurrent.setNumCapabilities' that automatically
--- detects the number of processors in the system, and is available
--- even when compiling with GHC<7.6.
+-- detects the number of processors in the system.
module GF.System.Concurrency(
-- * Controlling parallelism
setNumCapabilities,getNumberOfProcessors) where
@@ -16,13 +15,8 @@ import Foreign.C.Types(CInt(..))
-- hasn't already been set with @+RTS -N/n/ -RTS@.
setNumCapabilities opt_n =
do n <- maybe getNumberOfProcessors return opt_n
-#if MIN_VERSION_base(4,6,0)
C.setNumCapabilities n
return True
-#else
- n_now <- C.getNumCapabilities
- return (n==n_now)
-#endif
-- | Returns the number of processors in the system.
getNumberOfProcessors = fmap fromEnum c_getNumberOfProcessors
diff --git a/src/runtime/haskell/PGF/Optimize.hs b/src/runtime/haskell/PGF/Optimize.hs
index 45b4311a5..8739c8665 100644
--- a/src/runtime/haskell/PGF/Optimize.hs
+++ b/src/runtime/haskell/PGF/Optimize.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, BangPatterns #-}
+{-# LANGUAGE BangPatterns #-}
module PGF.Optimize
( optimizePGF
, updateProductionIndices
@@ -11,11 +11,7 @@ import PGF.Macros
import Data.List (mapAccumL)
import Data.Array.IArray
import Data.Array.MArray
-#if MIN_VERSION_base(4,6,0)
import Data.Array.Unsafe as U(unsafeFreeze)
-#else
-import Data.Array.ST as U(unsafeFreeze)
-#endif
import Data.Array.ST
import Data.Array.Unboxed
import qualified Data.Map as Map