From 8dfc2a149de639190067c2f7c47a5707bcb3dd94 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:44:35 +0000 Subject: [PATCH] compatibility with GHC 8.10.7 --- apps/simplex-bot-advanced/Main.hs | 2 +- .../src/Broadcast/Bot.hs | 2 +- apps/simplex-chat/Server.hs | 1 + .../src/Directory/Service.hs | 2 +- cabal.project | 10 ++++- package.yaml | 6 +-- simplex-chat.cabal | 42 +++++++++---------- src/Simplex/Chat.hs | 1 + src/Simplex/Chat/Archive.hs | 1 + src/Simplex/Chat/Bot.hs | 1 + src/Simplex/Chat/Mobile/File.hs | 1 + src/Simplex/Chat/Mobile/WebRTC.hs | 2 + src/Simplex/Chat/Store/Connections.hs | 1 + src/Simplex/Chat/Store/Direct.hs | 2 + src/Simplex/Chat/Store/Files.hs | 2 + src/Simplex/Chat/Store/Groups.hs | 2 + src/Simplex/Chat/Store/Messages.hs | 2 + src/Simplex/Chat/Store/Profiles.hs | 1 + src/Simplex/Chat/Store/Shared.hs | 2 + src/Simplex/Chat/Terminal.hs | 1 + src/Simplex/Chat/Terminal/Input.hs | 1 + src/Simplex/Chat/Util.hs | 1 + tests/ChatClient.hs | 1 + 23 files changed, 58 insertions(+), 29 deletions(-) diff --git a/apps/simplex-bot-advanced/Main.hs b/apps/simplex-bot-advanced/Main.hs index 510c9c30ba..50d7005e34 100644 --- a/apps/simplex-bot-advanced/Main.hs +++ b/apps/simplex-bot-advanced/Main.hs @@ -8,7 +8,7 @@ module Main where import Control.Concurrent.Async import Control.Concurrent.STM -import Control.Monad.Reader +import Control.Monad import qualified Data.Text as T import Simplex.Chat.Bot import Simplex.Chat.Controller diff --git a/apps/simplex-broadcast-bot/src/Broadcast/Bot.hs b/apps/simplex-broadcast-bot/src/Broadcast/Bot.hs index 326a8728ac..5fa3fff0a7 100644 --- a/apps/simplex-broadcast-bot/src/Broadcast/Bot.hs +++ b/apps/simplex-broadcast-bot/src/Broadcast/Bot.hs @@ -9,7 +9,7 @@ module Broadcast.Bot where import Control.Concurrent (forkIO) import Control.Concurrent.Async import Control.Concurrent.STM -import Control.Monad.Reader +import Control.Monad import qualified Data.Text as T import Broadcast.Options import Simplex.Chat.Bot diff --git a/apps/simplex-chat/Server.hs b/apps/simplex-chat/Server.hs index 46c71a7967..3f4484eac6 100644 --- a/apps/simplex-chat/Server.hs +++ b/apps/simplex-chat/Server.hs @@ -8,6 +8,7 @@ module Server where +import Control.Monad import Control.Monad.Except import Control.Monad.Reader import Data.Aeson (FromJSON, ToJSON) diff --git a/apps/simplex-directory-service/src/Directory/Service.hs b/apps/simplex-directory-service/src/Directory/Service.hs index 291457591f..fb187bbebe 100644 --- a/apps/simplex-directory-service/src/Directory/Service.hs +++ b/apps/simplex-directory-service/src/Directory/Service.hs @@ -15,7 +15,7 @@ where import Control.Concurrent (forkIO) import Control.Concurrent.Async import Control.Concurrent.STM -import Control.Monad.Reader +import Control.Monad import qualified Data.ByteString.Char8 as B import Data.List (sortOn) import Data.Maybe (fromMaybe, maybeToList) diff --git a/cabal.project b/cabal.project index 97d6a3330c..f86dad87cf 100644 --- a/cabal.project +++ b/cabal.project @@ -24,12 +24,12 @@ source-repository-package source-repository-package type: git location: https://github.com/simplex-chat/direct-sqlcipher.git - tag: 34309410eb2069b029b8fc1872deb1e0db123294 + tag: f814ee68b16a9447fbb467ccc8f29bdd3546bfd9 source-repository-package type: git location: https://github.com/simplex-chat/sqlcipher-simple.git - tag: 5e154a2aeccc33ead6c243ec07195ab673137221 + tag: a46bd361a19376c5211f1058908fc0ae6bf42446 source-repository-package type: git @@ -45,3 +45,9 @@ source-repository-package type: git location: https://github.com/simplex-chat/android-support.git tag: 9aa09f148089d6752ce563b14c2df1895718d806 + +-- TODO this fork is only needed to compile with GHC 8.10.7 - it allows previous base version +source-repository-package + type: git + location: https://github.com/simplex-chat/zip.git + tag: bd421c6b19cc4c465cd7af1f6f26169fb8ee1ebc diff --git a/package.yaml b/package.yaml index ab8e64660d..9bec2d95fa 100644 --- a/package.yaml +++ b/package.yaml @@ -19,11 +19,11 @@ dependencies: - attoparsec == 0.14.* - base >= 4.7 && < 5 - base64-bytestring >= 1.0 && < 1.3 - - bytestring == 0.10.* + - bytestring == 0.11.* - composition == 1.0.* - constraints >= 0.12 && < 0.14 - containers == 0.6.* - - cryptonite >= 0.27 && < 0.30 + - cryptonite == 0.30.* - data-default >= 0.7 && < 0.8 - directory == 1.3.* - direct-sqlcipher == 2.3.* @@ -45,7 +45,7 @@ dependencies: - socks == 0.6.* - sqlcipher-simple == 0.4.* - stm == 2.5.* - - template-haskell == 2.20.* + - template-haskell >= 2.16 && < 2.21 - terminal == 0.2.* - text == 2.0.* - time == 1.9.* diff --git a/simplex-chat.cabal b/simplex-chat.cabal index 8af3f6f5b9..93175fc3d7 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -171,11 +171,11 @@ library , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -197,7 +197,7 @@ library , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -223,11 +223,11 @@ executable simplex-bot , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -250,7 +250,7 @@ executable simplex-bot , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -276,11 +276,11 @@ executable simplex-bot-advanced , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -303,7 +303,7 @@ executable simplex-bot-advanced , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -331,11 +331,11 @@ executable simplex-broadcast-bot , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -358,7 +358,7 @@ executable simplex-broadcast-bot , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -385,11 +385,11 @@ executable simplex-chat , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -412,7 +412,7 @@ executable simplex-chat , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -443,11 +443,11 @@ executable simplex-directory-service , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , direct-sqlcipher ==2.3.* , directory ==1.3.* @@ -470,7 +470,7 @@ executable simplex-directory-service , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* @@ -524,11 +524,11 @@ test-suite simplex-chat-test , attoparsec ==0.14.* , base >=4.7 && <5 , base64-bytestring >=1.0 && <1.3 - , bytestring ==0.10.* + , bytestring ==0.11.* , composition ==1.0.* , constraints >=0.12 && <0.14 , containers ==0.6.* - , cryptonite >=0.27 && <0.30 + , cryptonite ==0.30.* , data-default ==0.7.* , deepseq ==1.4.* , direct-sqlcipher ==2.3.* @@ -555,7 +555,7 @@ test-suite simplex-chat-test , socks ==0.6.* , sqlcipher-simple ==0.4.* , stm ==2.5.* - , template-haskell ==2.20.* + , template-haskell >=2.16 && <2.21 , terminal ==0.2.* , text ==2.0.* , time ==1.9.* diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 1b46a642b5..bcd533a9a1 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -18,6 +18,7 @@ module Simplex.Chat where import Control.Applicative (optional, (<|>)) import Control.Concurrent.STM (retry) import Control.Logger.Simple +import Control.Monad import Control.Monad.Except import Control.Monad.IO.Unlift import Control.Monad.Reader diff --git a/src/Simplex/Chat/Archive.hs b/src/Simplex/Chat/Archive.hs index be7b05ea93..22e5f1ee2f 100644 --- a/src/Simplex/Chat/Archive.hs +++ b/src/Simplex/Chat/Archive.hs @@ -14,6 +14,7 @@ module Simplex.Chat.Archive where import qualified Codec.Archive.Zip as Z +import Control.Monad import Control.Monad.Except import Control.Monad.Reader import Data.Functor (($>)) diff --git a/src/Simplex/Chat/Bot.hs b/src/Simplex/Chat/Bot.hs index 4c0d37605e..3f7e2c2f09 100644 --- a/src/Simplex/Chat/Bot.hs +++ b/src/Simplex/Chat/Bot.hs @@ -8,6 +8,7 @@ module Simplex.Chat.Bot where import Control.Concurrent.Async import Control.Concurrent.STM +import Control.Monad import Control.Monad.Reader import qualified Data.ByteString.Char8 as B import qualified Data.Text as T diff --git a/src/Simplex/Chat/Mobile/File.hs b/src/Simplex/Chat/Mobile/File.hs index 284f56902c..1da64a3044 100644 --- a/src/Simplex/Chat/Mobile/File.hs +++ b/src/Simplex/Chat/Mobile/File.hs @@ -16,6 +16,7 @@ module Simplex.Chat.Mobile.File ) where +import Control.Monad import Control.Monad.Except import Control.Monad.IO.Class import qualified Data.Aeson as J diff --git a/src/Simplex/Chat/Mobile/WebRTC.hs b/src/Simplex/Chat/Mobile/WebRTC.hs index 588e285455..422cfd5a8c 100644 --- a/src/Simplex/Chat/Mobile/WebRTC.hs +++ b/src/Simplex/Chat/Mobile/WebRTC.hs @@ -8,7 +8,9 @@ module Simplex.Chat.Mobile.WebRTC reservedSize, ) where +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import qualified Crypto.Cipher.Types as AES import Data.Bifunctor (bimap) import qualified Data.ByteArray as BA diff --git a/src/Simplex/Chat/Store/Connections.hs b/src/Simplex/Chat/Store/Connections.hs index 019f2bae0d..a72b23886f 100644 --- a/src/Simplex/Chat/Store/Connections.hs +++ b/src/Simplex/Chat/Store/Connections.hs @@ -16,6 +16,7 @@ module Simplex.Chat.Store.Connections where import Control.Applicative ((<|>)) +import Control.Monad import Control.Monad.Except import Data.Int (Int64) import Data.Maybe (catMaybes, fromMaybe) diff --git a/src/Simplex/Chat/Store/Direct.hs b/src/Simplex/Chat/Store/Direct.hs index 427a5842f7..1b3a5285d6 100644 --- a/src/Simplex/Chat/Store/Direct.hs +++ b/src/Simplex/Chat/Store/Direct.hs @@ -66,7 +66,9 @@ module Simplex.Chat.Store.Direct ) where +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import Data.Either (rights) import Data.Functor (($>)) import Data.Int (Int64) diff --git a/src/Simplex/Chat/Store/Files.hs b/src/Simplex/Chat/Store/Files.hs index 927f4b9471..41d0733db1 100644 --- a/src/Simplex/Chat/Store/Files.hs +++ b/src/Simplex/Chat/Store/Files.hs @@ -77,7 +77,9 @@ module Simplex.Chat.Store.Files where import Control.Applicative ((<|>)) +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import Data.Either (rights) import Data.Int (Int64) import Data.Maybe (fromMaybe, isJust, listToMaybe) diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index 09aef8b910..a3dc5d815f 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -113,7 +113,9 @@ module Simplex.Chat.Store.Groups ) where +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import Crypto.Random (ChaChaDRG) import Data.Either (rights) import Data.Int (Int64) diff --git a/src/Simplex/Chat/Store/Messages.hs b/src/Simplex/Chat/Store/Messages.hs index 892f35fe58..102612b4ee 100644 --- a/src/Simplex/Chat/Store/Messages.hs +++ b/src/Simplex/Chat/Store/Messages.hs @@ -101,7 +101,9 @@ module Simplex.Chat.Store.Messages ) where +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import Crypto.Random (ChaChaDRG) import Data.Bifunctor (first) import Data.ByteString.Char8 (ByteString) diff --git a/src/Simplex/Chat/Store/Profiles.hs b/src/Simplex/Chat/Store/Profiles.hs index 35a990056e..7ce48db4a2 100644 --- a/src/Simplex/Chat/Store/Profiles.hs +++ b/src/Simplex/Chat/Store/Profiles.hs @@ -59,6 +59,7 @@ module Simplex.Chat.Store.Profiles ) where +import Control.Monad import Control.Monad.Except import Control.Monad.IO.Class import qualified Data.Aeson.TH as J diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index f07a89d336..93c3ab197c 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -12,7 +12,9 @@ module Simplex.Chat.Store.Shared where import Control.Exception (Exception) import qualified Control.Exception as E +import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import Crypto.Random (ChaChaDRG, randomBytesGenerate) import qualified Data.Aeson.TH as J import qualified Data.ByteString.Base64 as B64 diff --git a/src/Simplex/Chat/Terminal.hs b/src/Simplex/Chat/Terminal.hs index afc0ee4c30..76d3855dd7 100644 --- a/src/Simplex/Chat/Terminal.hs +++ b/src/Simplex/Chat/Terminal.hs @@ -5,6 +5,7 @@ module Simplex.Chat.Terminal where import Control.Exception (handle, throwIO) +import Control.Monad import Control.Monad.Except import qualified Data.List.NonEmpty as L import Database.SQLite.Simple (SQLError (..)) diff --git a/src/Simplex/Chat/Terminal/Input.hs b/src/Simplex/Chat/Terminal/Input.hs index 31d75f52d8..7b96abc1ce 100644 --- a/src/Simplex/Chat/Terminal/Input.hs +++ b/src/Simplex/Chat/Terminal/Input.hs @@ -12,6 +12,7 @@ module Simplex.Chat.Terminal.Input where import Control.Applicative (optional, (<|>)) import Control.Concurrent (forkFinally, forkIO, killThread, mkWeakThreadId, threadDelay) +import Control.Monad import Control.Monad.Except import Control.Monad.Reader import qualified Data.Attoparsec.ByteString.Char8 as A diff --git a/src/Simplex/Chat/Util.hs b/src/Simplex/Chat/Util.hs index 3ce663e69f..46b5be28b3 100644 --- a/src/Simplex/Chat/Util.hs +++ b/src/Simplex/Chat/Util.hs @@ -2,6 +2,7 @@ module Simplex.Chat.Util (week, encryptFile, chunkSize) where import Control.Monad import Control.Monad.Except +import Control.Monad.IO.Class import qualified Data.ByteString.Lazy as LB import Data.Time (NominalDiffTime) import Simplex.Messaging.Crypto.File (CryptoFile (..), CryptoFileArgs (..)) diff --git a/tests/ChatClient.hs b/tests/ChatClient.hs index 522f560e5d..53101cd073 100644 --- a/tests/ChatClient.hs +++ b/tests/ChatClient.hs @@ -13,6 +13,7 @@ import Control.Concurrent (forkIOWithUnmask, killThread, threadDelay) import Control.Concurrent.Async import Control.Concurrent.STM import Control.Exception (bracket, bracket_) +import Control.Monad import Control.Monad.Except import Data.Functor (($>)) import Data.List (dropWhileEnd, find)