From 75cf21839bed9665efd4bc7339fb7d3251094d42 Mon Sep 17 00:00:00 2001 From: j6carey Date: Mon, 25 Mar 2019 16:52:04 -0700 Subject: [PATCH] Port grpc-haskell[-core] to ghc-8.6 and modern tasty. (#77) Note that even though we can now build grpc-haskell and grpc-haskell-core with modern tasty, the environment in which we built those test programs did not support actually running all them successfully, due to the need to test generated code in the context of the appropriate libraries. We do not yet know whether test programs built with new versions of tasty would succeed in the appropriate environment. In principle this could be discovered, but the work involved is far from trivial, and therefore we defer it to another time. Tests built with the old tasty still succeed. --- core/grpc-haskell-core.cabal | 14 +++++++------- core/shell.nix | 1 + core/src/Network/GRPC/LowLevel/Call.hs | 2 +- core/src/Network/GRPC/Unsafe/Metadata.chs | 2 +- core/tests/UnsafeTests.hs | 4 ++-- grpc-haskell.cabal | 20 ++++++++++---------- shell.nix | 1 + 7 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 core/shell.nix create mode 100644 shell.nix diff --git a/core/grpc-haskell-core.cabal b/core/grpc-haskell-core.cabal index 959cb70..61afb83 100644 --- a/core/grpc-haskell-core.cabal +++ b/core/grpc-haskell-core.cabal @@ -21,8 +21,8 @@ library base >=4.8 && <5.0 , clock >=0.6.0 && <0.8.0 , bytestring ==0.10.* - , stm == 2.4.* - , containers ==0.5.* + , stm >=2.4 && <2.6 + , containers >=0.5 && <0.7 , managed >= 1.0.0 && < 1.1 , transformers , sorted-list >=0.1.6.1 && <=0.3 @@ -80,11 +80,11 @@ test-suite tests , bytestring ==0.10.* , unix , time - , async ==2.1.* - , tasty >= 0.11 && <0.12 - , tasty-hunit >= 0.9 && <0.10 - , tasty-quickcheck >= 0.8.4 && < 0.9 - , containers ==0.5.* + , async >=2.1 && <2.3 + , tasty >= 0.11 + , tasty-hunit >= 0.9 + , tasty-quickcheck >= 0.8.4 + , containers >=0.5 && <0.7 , managed >= 1.0.0 && < 1.1 , pipes >=4.1 && <=4.4 , proto3-suite diff --git a/core/shell.nix b/core/shell.nix new file mode 100644 index 0000000..b61179c --- /dev/null +++ b/core/shell.nix @@ -0,0 +1 @@ +(import ../release.nix).grpc-haskell-core.env diff --git a/core/src/Network/GRPC/LowLevel/Call.hs b/core/src/Network/GRPC/LowLevel/Call.hs index 8f71bd0..9349ac9 100644 --- a/core/src/Network/GRPC/LowLevel/Call.hs +++ b/core/src/Network/GRPC/LowLevel/Call.hs @@ -20,7 +20,7 @@ import Control.Exception (bracket) import Data.ByteString (ByteString) import Data.ByteString.Char8 (pack) import Data.List (intersperse) -import Data.Monoid +import Data.Semigroup ((<>)) import Data.String (IsString) import Foreign.Marshal.Alloc (free, malloc) import Foreign.Ptr (Ptr, nullPtr) diff --git a/core/src/Network/GRPC/Unsafe/Metadata.chs b/core/src/Network/GRPC/Unsafe/Metadata.chs index 9dd71a0..270ca0a 100644 --- a/core/src/Network/GRPC/Unsafe/Metadata.chs +++ b/core/src/Network/GRPC/Unsafe/Metadata.chs @@ -12,7 +12,7 @@ import Data.Function (on) import Data.ByteString (ByteString, useAsCString, useAsCStringLen) import Data.List (sortBy, groupBy) -import Data.Semigroup +import Data.Semigroup (Semigroup((<>))) import qualified Data.SortedList as SL import qualified Data.Map.Strict as M import Data.Ord (comparing) diff --git a/core/tests/UnsafeTests.hs b/core/tests/UnsafeTests.hs index 936378a..eb8ba84 100644 --- a/core/tests/UnsafeTests.hs +++ b/core/tests/UnsafeTests.hs @@ -19,8 +19,8 @@ import Network.GRPC.Unsafe.Security import Network.GRPC.Unsafe.Slice import Network.GRPC.Unsafe.Time import System.Clock -import Test.QuickCheck.Gen as QC -import Test.QuickCheck.Property as QC +import Test.QuickCheck.Gen +import qualified Test.QuickCheck.Property as QC import Test.Tasty import Test.Tasty.HUnit as HU (testCase, (@?=)) import Test.Tasty.QuickCheck as QC diff --git a/grpc-haskell.cabal b/grpc-haskell.cabal index 98c2b17..5398e4e 100644 --- a/grpc-haskell.cabal +++ b/grpc-haskell.cabal @@ -53,7 +53,7 @@ executable hellos-server base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , proto3-suite @@ -73,7 +73,7 @@ executable hellos-client base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , proto3-suite @@ -93,7 +93,7 @@ executable echo-server base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , optparse-generic @@ -117,7 +117,7 @@ executable arithmetic-server base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , optparse-generic @@ -140,7 +140,7 @@ executable arithmetic-client base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , optparse-generic @@ -163,7 +163,7 @@ executable echo-client base >=4.8 && <5.0 , async , bytestring == 0.10.* - , containers ==0.5.* + , containers >=0.5 && <0.7 , grpc-haskell , grpc-haskell-core , optparse-generic @@ -189,10 +189,10 @@ test-suite tests , unix , time , async - , tasty >= 0.11 && <0.12 - , tasty-hunit >= 0.9 && <0.10 - , tasty-quickcheck >= 0.8.4 && < 0.9 - , containers ==0.5.* + , tasty >= 0.11 + , tasty-hunit >= 0.9 + , tasty-quickcheck >= 0.8.4 + , containers >=0.5 && <0.7 , managed >= 1.0.0 && < 1.1 , pipes >=4.1 && <=4.4 , proto3-suite diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..39b5c83 --- /dev/null +++ b/shell.nix @@ -0,0 +1 @@ +(import ./release.nix).grpc-haskell.env