From a2faa667f3870bb37b22f4f67eed92ac671b41df Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Thu, 30 Apr 2026 19:56:33 +0500 Subject: [PATCH] chore: build postgrest with vendored protolude Signed-off-by: Taimoor Zaeem --- postgrest.cabal | 58 +++++++++++++++++++++++++++++--- src/protolude/Protolude/Error.hs | 2 +- src/protolude/Protolude/Panic.hs | 3 +- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/postgrest.cabal b/postgrest.cabal index 2a819d80b..19ad69131 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -136,7 +136,7 @@ library , parsec >= 3.1.11 && < 3.2 , postgresql-libpq >= 0.10 , prometheus-client >= 1.1.1 && < 1.2.0 - , protolude >= 0.3.1 && < 0.4 + , protolude , regex-tdfa >= 1.2.2 && < 1.4 , retry >= 0.7.4 && < 0.10 , scientific >= 0.3.4 && < 0.4 @@ -180,6 +180,54 @@ library build-depends: unix +library protolude + visibility: private + default-language: Haskell2010 + default-extensions: NoImplicitPrelude + FlexibleContexts + MultiParamTypeClasses + OverloadedStrings + hs-source-dirs: src/protolude + exposed-modules: Protolude + Protolude.Applicative + Protolude.Base + Protolude.Bifunctor + Protolude.Bool + Protolude.CallStack + Protolude.Conv + Protolude.ConvertText + Protolude.Debug + Protolude.Either + Protolude.Error + Protolude.Exceptions + Protolude.Functor + Protolude.List + Protolude.Monad + Protolude.Panic + Protolude.Partial + Protolude.Safe + Protolude.Semiring + Protolude.Show + Protolude.Unsafe + build-depends: array >= 0.4 && < 0.6 + , async >= 2.0 && < 2.3 + , base >= 4.6 && < 4.22 + , bytestring >= 0.10.8 && < 0.13 + , containers >= 0.5.7 && < 0.8 + , deepseq >= 1.3 && < 1.6 + , ghc-prim >= 0.3 && < 0.14 + , hashable >= 1.2 && < 1.6 + , mtl >= 2.1 && < 2.4 + , mtl-compat >= 0.2 && < 0.3 + , stm >= 2.5 && < 3 + , text >= 1.2.2 && < 2.2 + , transformers >= 0.2 && < 0.7 + , transformers-compat >= 0.4 && < 0.8 + -- Protolude has some partial functions, so + -- it is fine to disable that specific warning + ghc-options: -Werror -Wall -fwarn-identities -Wno-x-partial + -fno-spec-constr -optP-Wno-nonportable-include-path + executable postgrest default-language: Haskell2010 default-extensions: OverloadedStrings @@ -189,7 +237,7 @@ executable postgrest build-depends: base >= 4.9 && < 4.22 , containers >= 0.5.7 && < 0.8 , postgrest - , protolude >= 0.3.1 && < 0.4 + , protolude ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I0 -qg" -O2 -Werror -Wall -fwarn-identities -fno-spec-constr -optP-Wno-nonportable-include-path @@ -285,7 +333,7 @@ test-suite spec , postgrest , process >= 1.4.2 && < 1.7 , prometheus-client >= 1.1.1 && < 1.2.0 - , protolude >= 0.3.1 && < 0.4 + , protolude , regex-tdfa >= 1.2.2 && < 1.4 , scientific >= 0.3.4 && < 0.4 , text >= 1.2.2 && < 2.2 @@ -324,7 +372,7 @@ test-suite observability , jose-jwt >= 0.9.6 && < 0.11 , postgrest , prometheus-client >= 1.1.1 && < 1.2.0 - , protolude >= 0.3.1 && < 0.4 + , protolude , text >= 1.2.2 && < 2.2 , wai >= 3.2.1 && < 3.3 ghc-options: -threaded -O0 -Werror -Wall -fwarn-identities @@ -344,6 +392,6 @@ test-suite doctests , doctest >= 0.8 , postgrest , pretty-simple - , protolude >= 0.3.1 && < 0.4 + , protolude ghc-options: -threaded -O0 -Werror -Wall -fwarn-identities -fno-spec-constr -optP-Wno-nonportable-include-path diff --git a/src/protolude/Protolude/Error.hs b/src/protolude/Protolude/Error.hs index deb83fa3c..3d9ada7eb 100644 --- a/src/protolude/Protolude/Error.hs +++ b/src/protolude/Protolude/Error.hs @@ -4,7 +4,7 @@ {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ExistentialQuantification #-} #if ( __GLASGOW_HASKELL__ >= 800 ) -{-# LANGUAGE TypeInType #-} +{-# LANGUAGE DataKinds #-} #endif #if MIN_VERSION_base(4,9,0) diff --git a/src/protolude/Protolude/Panic.hs b/src/protolude/Protolude/Panic.hs index 92392a414..217dac228 100644 --- a/src/protolude/Protolude/Panic.hs +++ b/src/protolude/Protolude/Panic.hs @@ -14,12 +14,11 @@ module Protolude.Panic ( import Protolude.Base (Show) import Protolude.CallStack (HasCallStack) import Data.Text (Text) -import Data.Typeable (Typeable) import Control.Exception as X -- | Uncatchable exceptions thrown and never caught. newtype FatalError = FatalError { fatalErrorMessage :: Text } - deriving (Show, Typeable) + deriving (Show) instance Exception FatalError