Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

haskellPackages.beam-*: GHC 8.6.x fixes, and relax version bounds

authored by

Jack Kelly and committed by
Peter Simons
f5d52c19 230d55ed

+179
+12
pkgs/development/haskell-modules/configuration-common.nix
··· 1178 1178 hlint = super.hlint.overrideScope (self: super: { haskell-src-exts = self.haskell-src-exts_1_21_0; }); 1179 1179 hoogle = super.hoogle.overrideScope (self: super: { haskell-src-exts = self.haskell-src-exts_1_21_0; }); 1180 1180 1181 + # jailbreak tasty < 1.2: https://github.com/phadej/tdigest/issues/30 1182 + tdigest = doJailbreak super.tdigest; # until tdigest > 0.2.1 1183 + 1184 + # These patches contain fixes for 8.6 that should be safe for 1185 + # earlier versions, but we need the relaxed version bounds in GHC 1186 + # 8.4 builds. beam needs to release a round of updates that relax 1187 + # bounds and include the 8.6 fixes: 1188 + # https://github.com/tathougies/beam/issues/315 1189 + beam-core = appendPatch super.beam-core ./patches/beam-core-fix-ghc-8.6.x-build.patch; 1190 + beam-migrate = appendPatch super.beam-migrate ./patches/beam-migrate-fix-ghc-8.6.x-build.patch; 1191 + beam-postgres = appendPatch super.beam-postgres ./patches/beam-postgres-fix-ghc-8.6.x-build.patch; 1192 + beam-sqlite = appendPatch super.beam-sqlite ./patches/beam-sqlite-fix-ghc-8.6.x-build.patch; 1181 1193 } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super
+72
pkgs/development/haskell-modules/patches/beam-core-fix-ghc-8.6.x-build.patch
··· 1 + diff --git a/beam-core/Database/Beam/Backend/SQL.hs b/beam-core/Database/Beam/Backend/SQL.hs 2 + index e2cd37d0..6f9db126 100644 3 + --- a/Database/Beam/Backend/SQL.hs 4 + +++ b/Database/Beam/Backend/SQL.hs 5 + @@ -10,6 +10,7 @@ 6 + import Database.Beam.Backend.Types 7 + 8 + import Control.Monad.IO.Class 9 + +import Control.Monad.Fail (MonadFail) 10 + 11 + -- * MonadBeam class 12 + 13 + @@ -29,7 +30,7 @@ 14 + -- strategies. More complicated strategies (for example, Postgres's @COPY@) 15 + -- are supported in individual backends. See the documentation of those 16 + -- backends for more details. 17 + -class (BeamBackend be, Monad m, MonadIO m, Sql92SanityCheck syntax) => 18 + +class (BeamBackend be, Monad m, MonadIO m, MonadFail m, Sql92SanityCheck syntax) => 19 + MonadBeam syntax be handle m | m -> syntax be handle where 20 + 21 + {-# MINIMAL withDatabaseDebug, runReturningMany #-} 22 + diff --git a/Database/Beam/Backend/SQL/Builder.hs b/Database/Beam/Backend/SQL/Builder.hs 23 + index 9e734036..e9849912 100644 24 + --- a/Database/Beam/Backend/SQL/Builder.hs 25 + +++ b/Database/Beam/Backend/SQL/Builder.hs 26 + @@ -33,6 +33,7 @@ 27 + import Data.Hashable 28 + import Data.Int 29 + import Data.String 30 + +import qualified Control.Monad.Fail as Fail 31 + #if !MIN_VERSION_base(4, 11, 0) 32 + import Data.Semigroup 33 + #endif 34 + @@ -507,8 +508,10 @@ 35 + type BackendFromField SqlSyntaxBackend = Trivial 36 + 37 + newtype SqlSyntaxM a = SqlSyntaxM (IO a) 38 + - deriving (Applicative, Functor, Monad, MonadIO) 39 + + deriving (Applicative, Functor, Monad, MonadIO, Fail.MonadFail) 40 + 41 + instance MonadBeam SqlSyntaxBuilder SqlSyntaxBackend SqlSyntaxBackend SqlSyntaxM where 42 + - withDatabaseDebug _ _ _ = fail "absurd" 43 + - runReturningMany _ _ = fail "absurd" 44 + + withDatabaseDebug _ _ _ = Fail.fail "absurd" 45 + + runReturningMany _ _ = Fail.fail "absurd" 46 + + 47 + + 48 + diff --git a/Database/Beam/Schema/Lenses.hs b/Database/Beam/Schema/Lenses.hs 49 + index b21dddb6..5df0654c 100644 50 + --- a/Database/Beam/Schema/Lenses.hs 51 + +++ b/Database/Beam/Schema/Lenses.hs 52 + @@ -1,4 +1,5 @@ 53 + {-# LANGUAGE PolyKinds #-} 54 + +{-# LANGUAGE UndecidableInstances #-} 55 + module Database.Beam.Schema.Lenses 56 + ( tableLenses 57 + , TableLens(..) 58 + diff --git a/beam-core.cabal b/beam-core.cabal 59 + index 4bf4ffd9..251d4d85 100644 60 + --- a/beam-core.cabal 61 + +++ b/beam-core.cabal 62 + @@ -64,8 +64,8 @@ 63 + time >=1.6 && <1.10, 64 + hashable >=1.1 && <1.3, 65 + network-uri >=2.6 && <2.7, 66 + - containers >=0.5 && <0.6, 67 + - vector-sized >=0.5 && <1.1, 68 + + containers >=0.5 && <0.7, 69 + + vector-sized >=0.5 && <1.3, 70 + tagged >=0.8 && <0.9 71 + Default-language: Haskell2010 72 + default-extensions: ScopedTypeVariables, OverloadedStrings, GADTs, RecursiveDo, FlexibleInstances, FlexibleContexts, TypeFamilies,
+29
pkgs/development/haskell-modules/patches/beam-migrate-fix-ghc-8.6.x-build.patch
··· 1 + diff --git a/Database/Beam/Migrate/Generics/Types.hs b/Database/Beam/Migrate/Generics/Types.hs 2 + index 553e208b..0cf9b2c8 100644 3 + --- a/Database/Beam/Migrate/Generics/Types.hs 4 + +++ b/Database/Beam/Migrate/Generics/Types.hs 5 + @@ -1,3 +1,5 @@ 6 + +{-# LANGUAGE UndecidableInstances #-} 7 + + 8 + module Database.Beam.Migrate.Generics.Types where 9 + 10 + import Database.Beam.Migrate.Types 11 + diff --git a/beam-migrate.cabal b/beam-migrate.cabal 12 + index f53b280d..9cf3722c 100644 13 + --- a/beam-migrate.cabal 14 + +++ b/beam-migrate.cabal 15 + @@ -69,13 +69,12 @@ library 16 + mtl >=2.2 && <2.3, 17 + scientific >=0.3 && <0.4, 18 + vector >=0.11 && <0.13, 19 + - containers >=0.5 && <0.6, 20 + unordered-containers >=0.2 && <0.3, 21 + hashable >=1.2 && <1.3, 22 + parallel >=3.2 && <3.3, 23 + deepseq >=1.4 && <1.5, 24 + ghc-prim >=0.5 && <0.6, 25 + - containers >=0.5 && <0.6, 26 + + containers >=0.5 && <0.7, 27 + haskell-src-exts >=1.18 && <1.21, 28 + pretty >=1.1 && <1.2, 29 + dependent-map >=0.2 && <0.3,
+45
pkgs/development/haskell-modules/patches/beam-postgres-fix-ghc-8.6.x-build.patch
··· 1 + diff --git a/Database/Beam/Postgres/Connection.hs b/Database/Beam/Postgres/Connection.hs 2 + index 433f55b9..5836c53d 100644 3 + --- a/Database/Beam/Postgres/Connection.hs 4 + +++ b/Database/Beam/Postgres/Connection.hs 5 + @@ -52,6 +52,8 @@ import qualified Database.PostgreSQL.Simple.Types as Pg (Null(..), Query(..)) 6 + 7 + import Control.Monad.Reader 8 + import Control.Monad.State 9 + +import Control.Monad.Fail (MonadFail) 10 + +import qualified Control.Monad.Fail as Fail 11 + 12 + import Data.ByteString (ByteString) 13 + import Data.ByteString.Builder (toLazyByteString, byteString) 14 + @@ -302,6 +304,9 @@ deriving instance Functor PgF 15 + newtype Pg a = Pg { runPg :: F PgF a } 16 + deriving (Monad, Applicative, Functor, MonadFree PgF) 17 + 18 + +instance MonadFail Pg where 19 + + fail e = fail $ "Internal Error with: " <> show e 20 + + 21 + instance MonadIO Pg where 22 + liftIO x = liftF (PgLiftIO x id) 23 + 24 + diff --git a/beam-postgres.cabal b/beam-postgres.cabal 25 + index e14b84f5..d29a5b67 100644 26 + --- a/beam-postgres.cabal 27 + +++ b/beam-postgres.cabal 28 + @@ -31,7 +31,7 @@ library 29 + beam-migrate >=0.3 && <0.4, 30 + 31 + postgresql-libpq >=0.8 && <0.10, 32 + - postgresql-simple >=0.5 && <0.6, 33 + + postgresql-simple >=0.5 && <0.7, 34 + 35 + text >=1.0 && <1.3, 36 + bytestring >=0.10 && <0.11, 37 + @@ -38,7 +38,7 @@ library 38 + 39 + hashable >=1.1 && <1.3, 40 + lifted-base >=0.2 && <0.3, 41 + - free >=4.12 && <5.1, 42 + + free >=4.12 && <5.2, 43 + time >=1.6 && <1.10, 44 + monad-control >=1.0 && <1.1, 45 + mtl >=2.1 && <2.3,
+21
pkgs/development/haskell-modules/patches/beam-sqlite-fix-ghc-8.6.x-build.patch
··· 1 + diff --git a/Database/Beam/Sqlite/Connection.hs b/Database/Beam/Sqlite/Connection.hs 2 + index f034b272..4e459ea3 100644 3 + --- a/Database/Beam/Sqlite/Connection.hs 4 + +++ b/Database/Beam/Sqlite/Connection.hs 5 + @@ -37,6 +37,7 @@ import Database.SQLite.Simple.Types (Null) 6 + 7 + import Control.Exception (bracket_, onException, mask) 8 + import Control.Monad (forM_, replicateM_) 9 + +import Control.Monad.Fail (MonadFail) 10 + import Control.Monad.Free.Church 11 + import Control.Monad.IO.Class (MonadIO(..)) 12 + import Control.Monad.Identity (Identity) 13 + @@ -143,7 +144,7 @@ newtype SqliteM a 14 + { runSqliteM :: ReaderT (String -> IO (), Connection) IO a 15 + -- ^ Run an IO action with access to a SQLite connection and a debug logging 16 + -- function, called or each query submitted on the connection. 17 + - } deriving (Monad, Functor, Applicative, MonadIO) 18 + + } deriving (Monad, Functor, Applicative, MonadIO, MonadFail) 19 + 20 + newtype BeamSqliteParams = BeamSqliteParams [SQLData] 21 + instance ToRow BeamSqliteParams where