From 95477cae7e25bf783bc0844ad4f1ac2cad5de151 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:45:50 +0100 Subject: [PATCH 01/21] core: use commit from simplexmq branch master-ghc8107 --- cabal.project | 2 +- scripts/nix/sha256map.nix | 2 +- stack.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index 983468726a..58580d357f 100644 --- a/cabal.project +++ b/cabal.project @@ -9,7 +9,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 0cabe0690beee90f460ad7bada72294222e7e109 + tag: 343865553295da5edeef30c1d8589b47c66bd9b0 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 493985085a..18f776b92a 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."0cabe0690beee90f460ad7bada72294222e7e109" = "1yfcrifb2l59wgl14q56ywlil2g2zs57ic62s617whh3w2mnh0kz"; + "https://github.com/simplex-chat/simplexmq.git"."343865553295da5edeef30c1d8589b47c66bd9b0" = "01md63iq78swfr6rn0b3a10168ivcha4ql37hk0k4knfqc09fv45"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/kazu-yamamoto/http2.git"."b5a1b7200cf5bc7044af34ba325284271f6dff25" = "0dqb50j57an64nf4qcf5vcz4xkd1vzvghvf8bk529c1k30r9nfzb"; "https://github.com/simplex-chat/direct-sqlcipher.git"."34309410eb2069b029b8fc1872deb1e0db123294" = "0kwkmhyfsn2lixdlgl15smgr1h5gjk7fky6abzh8rng2h5ymnffd"; diff --git a/stack.yaml b/stack.yaml index 18d5afe8b9..89729a58c2 100644 --- a/stack.yaml +++ b/stack.yaml @@ -49,7 +49,7 @@ extra-deps: # - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561 # - ../simplexmq - github: simplex-chat/simplexmq - commit: 0cabe0690beee90f460ad7bada72294222e7e109 + commit: 343865553295da5edeef30c1d8589b47c66bd9b0 - github: kazu-yamamoto/http2 commit: b5a1b7200cf5bc7044af34ba325284271f6dff25 # - ../direct-sqlcipher From 8f57925067980db81dcf90f4301488432ea88cfc Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:01:25 +0100 Subject: [PATCH 02/21] compatibility with GHC 8.10.7 --- src/Simplex/Chat/Mobile/Shared.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Simplex/Chat/Mobile/Shared.hs b/src/Simplex/Chat/Mobile/Shared.hs index d0c5b0b86e..d1f60ffce5 100644 --- a/src/Simplex/Chat/Mobile/Shared.hs +++ b/src/Simplex/Chat/Mobile/Shared.hs @@ -16,12 +16,12 @@ type JSONByteString = LB.ByteString getByteString :: Ptr Word8 -> CInt -> IO ByteString getByteString ptr len = do fp <- newForeignPtr_ ptr - pure $ BS fp $ fromIntegral len + pure $ PS fp 0 $ fromIntegral len {-# INLINE getByteString #-} putByteString :: Ptr Word8 -> ByteString -> IO () -putByteString ptr (BS fp len) = - withForeignPtr fp $ \p -> memcpy ptr p len +putByteString ptr (PS fp offset len) = + withForeignPtr fp $ \p -> memcpy ptr (p `plusPtr` offset) len {-# INLINE putByteString #-} putLazyByteString :: Ptr Word8 -> LB.ByteString -> IO () From 7692195bfaf33b5c8cf1a9f014c07f34f5a937e4 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:57:53 +0100 Subject: [PATCH 03/21] core: fix for ghc 8.10.7 --- src/Simplex/Chat.hs | 2 +- src/Simplex/Chat/Store/Shared.hs | 1 - src/Simplex/Chat/Util.hs | 1 - src/Simplex/Chat/View.hs | 4 ++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index c58fef8602..f0c079cf5f 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -15,7 +15,7 @@ module Simplex.Chat where import Control.Applicative (optional, (<|>)) -import Control.Concurrent.STM (retry, stateTVar) +import Control.Concurrent.STM (retry) import Control.Logger.Simple import Control.Monad.Except import Control.Monad.IO.Unlift diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index 2209ca8cfa..df0d8d9f77 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -10,7 +10,6 @@ module Simplex.Chat.Store.Shared where -import Control.Concurrent.STM (stateTVar) import Control.Exception (Exception) import qualified Control.Exception as E import Control.Monad.Except diff --git a/src/Simplex/Chat/Util.hs b/src/Simplex/Chat/Util.hs index 46b5be28b3..3ce663e69f 100644 --- a/src/Simplex/Chat/Util.hs +++ b/src/Simplex/Chat/Util.hs @@ -2,7 +2,6 @@ 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/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 4b0398dfd4..ff72f9b4c2 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -885,10 +885,10 @@ viewContactConnected ct userIncognitoProfile testView = viewGroupsList :: [(GroupInfo, GroupSummary)] -> [StyledString] viewGroupsList [] = ["you have no groups!", "to create: " <> highlight' "/g "] -viewGroupsList gs = map groupSS $ sortOn ldn_ gs +viewGroupsList gs = map groupSS $ sortOn (ldn_ . fst) gs where ldn_ :: GroupInfo -> Text - ldn_ = T.toLower . (localDisplayName :: GroupInfo -> GroupName) . fst + ldn_ = T.toLower . (localDisplayName :: GroupInfo -> GroupName) groupSS (g@GroupInfo {membership, chatSettings = ChatSettings {enableNtfs}}, GroupSummary {currentMembers}) = case memberStatus membership of GSMemInvited -> groupInvitation' g From c7a8992043d86cc5cf089d4ec18df5651e8defc4 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 16 Oct 2023 20:05:13 +0400 Subject: [PATCH 04/21] core: fix compilation for ghc 8.10.7 --- src/Simplex/Chat.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 16b804471d..3f377fbd70 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2234,6 +2234,7 @@ processChatCommand = \case ( CRInvitationUri crData {crScheme = CRSSimplex} e2e, CRInvitationUri crData {crScheme = simplexChat} e2e ) + _ -> (cReq, cReq) -- ghc8107 connectPlan user (ACR SCMContact cReq) = do let CRContactUri ConnReqUriData {crClientData} = cReq groupLinkId = crClientData >>= decodeJSON >>= \(CRDataGroup gli) -> Just gli @@ -2277,6 +2278,7 @@ processChatCommand = \case ( CRContactUri crData {crScheme = CRSSimplex}, CRContactUri crData {crScheme = simplexChat} ) + _ -> (cReq, cReq) -- ghc8107 cReqHashes :: (ConnReqUriHash, ConnReqUriHash) cReqHashes = bimap hash hash cReqSchemas hash = ConnReqUriHash . C.sha256Hash . strEncode From 1f5b80d56051ae6f9503be1de335766e2ba00e2a Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 4 Nov 2023 13:37:25 +0000 Subject: [PATCH 05/21] fix for ghc8107 --- src/Simplex/Chat/Types.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simplex/Chat/Types.hs b/src/Simplex/Chat/Types.hs index 532b442b07..2ba382515b 100644 --- a/src/Simplex/Chat/Types.hs +++ b/src/Simplex/Chat/Types.hs @@ -208,7 +208,7 @@ directOrUsed ct@Contact {contactUsed} = contactDirect ct || contactUsed anyDirectOrUsed :: Contact -> Bool -anyDirectOrUsed Contact {contactUsed, activeConn} = ((\c -> c.connLevel) <$> activeConn) == Just 0 || contactUsed +anyDirectOrUsed Contact {contactUsed, activeConn} = ((\Connection {connLevel} -> connLevel) <$> activeConn) == Just 0 || contactUsed contactReady :: Contact -> Bool contactReady Contact {activeConn} = maybe False connReady activeConn From e1a80994743da3dd7f1b32c02147b97b7090bdc8 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 00:06:45 +0000 Subject: [PATCH 06/21] fix for GHC 8.10.7 --- src/Simplex/Chat.hs | 24 ++++++++++++------------ src/Simplex/Chat/Store/Groups.hs | 2 +- src/Simplex/Chat/View.hs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 58495727af..68b73fccb0 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -3529,19 +3529,19 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do forM_ (invitedByGroupMemberId membership) $ \hostId -> do host <- withStore $ \db -> getGroupMember db user groupId hostId forM_ (memberConn host) $ \hostConn -> - void $ sendDirectMessage hostConn (XGrpMemCon m.memberId) (GroupId groupId) + void $ sendDirectMessage hostConn (XGrpMemCon $ memberId (m :: GroupMember)) (GroupId groupId) GCPostMember -> forM_ (invitedByGroupMemberId m) $ \invitingMemberId -> do im <- withStore $ \db -> getGroupMember db user groupId invitingMemberId forM_ (memberConn im) $ \imConn -> - void $ sendDirectMessage imConn (XGrpMemCon m.memberId) (GroupId groupId) + void $ sendDirectMessage imConn (XGrpMemCon $ memberId (m :: GroupMember)) (GroupId groupId) _ -> messageWarning "sendXGrpMemCon: member category GCPreMember or GCPostMember is expected" MSG msgMeta _msgFlags msgBody -> do cmdId <- createAckCmd conn tryChatError (processChatMessage cmdId) >>= \case Right (ACMsg _ chatMsg, withRcpt) -> do ackMsg agentConnId cmdId msgMeta $ if withRcpt then Just "" else Nothing - when (membership.memberRole >= GRAdmin) $ forwardMsg_ chatMsg + when (memberRole (membership :: GroupMember) >= GRAdmin) $ forwardMsg_ chatMsg Left e -> ackMsg agentConnId cmdId msgMeta Nothing >> throwError e where processChatMessage :: Int64 -> m (AChatMessage, Bool) @@ -3619,7 +3619,7 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do -- invited members to which this member was introduced invitedMembers <- withStore' $ \db -> getForwardInvitedMembers db user m highlyAvailable let ms = introducedMembers <> invitedMembers - msg = XGrpMsgForward m.memberId chatMsg' brokerTs + msg = XGrpMsgForward (memberId (m :: GroupMember)) chatMsg' brokerTs unless (null ms) $ void $ sendGroupMessage user gInfo ms msg RCVD msgMeta msgRcpt -> @@ -5135,8 +5135,8 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do createInternalChatItem user (CDDirectRcv ct) (CIRcvConnEvent RCEVerificationCodeReset) Nothing xGrpMsgForward :: GroupInfo -> GroupMember -> MemberId -> ChatMessage 'Json -> UTCTime -> m () - xGrpMsgForward gInfo@GroupInfo {groupId} m memberId msg msgTs = do - when (m.memberRole < GRAdmin) $ throwChatError (CEGroupContactRole m.localDisplayName) + xGrpMsgForward gInfo@GroupInfo {groupId} m@GroupMember {memberRole, localDisplayName} memberId msg msgTs = do + when (memberRole < GRAdmin) $ throwChatError (CEGroupContactRole localDisplayName) author <- withStore $ \db -> getGroupMemberByMemberId db user gInfo memberId processForwardedMsg author msg where @@ -5502,7 +5502,7 @@ sendGroupMessage' user members chatMsgEvent groupId introId_ postDeliver = do forwardSupported = do let mcvr = memberChatVRange' m isCompatibleRange mcvr groupForwardVRange && invitingMemberSupportsForward - invitingMemberSupportsForward = case m.invitedByGroupMemberId of + invitingMemberSupportsForward = case invitedByGroupMemberId m of Just invMemberId -> -- can be optimized for large groups by replacing [GroupMember] with Map GroupMemberId GroupMember case find (\m' -> groupMemberId' m' == invMemberId) members of @@ -5547,13 +5547,13 @@ saveGroupRcvMsg user groupId authorMember conn@Connection {connId} agentMsgMeta let agentMsgId = fst $ recipient agentMsgMeta newMsg = NewMessage {chatMsgEvent, msgBody} rcvMsgDelivery = RcvMsgDelivery {connId, agentMsgId, agentMsgMeta, agentAckCmdId} - amId = Just am'.groupMemberId + amId = Just $ groupMemberId' am' msg <- withStore (\db -> createNewMessageAndRcvMsgDelivery db (GroupId groupId) newMsg sharedMsgId_ rcvMsgDelivery amId) `catchChatError` \e -> case e of ChatErrorStore (SEDuplicateGroupMessage _ _ _ (Just forwardedByGroupMemberId)) -> do fm <- withStore $ \db -> getGroupMember db user groupId forwardedByGroupMemberId forM_ (memberConn fm) $ \fmConn -> - void $ sendDirectMessage fmConn (XGrpMemCon am'.memberId) (GroupId groupId) + void $ sendDirectMessage fmConn (XGrpMemCon $ memberId (am' :: GroupMember)) (GroupId groupId) throwError e _ -> throwError e pure (am', conn', msg) @@ -5567,9 +5567,9 @@ saveGroupFwdRcvMsg user groupId forwardingMember refAuthorMember msgBody ChatMes `catchChatError` \e -> case e of ChatErrorStore (SEDuplicateGroupMessage _ _ (Just authorGroupMemberId) Nothing) -> do am <- withStore $ \db -> getGroupMember db user groupId authorGroupMemberId - if sameMemberId refAuthorMember.memberId am + if sameMemberId (memberId (refAuthorMember :: GroupMember)) am then forM_ (memberConn forwardingMember) $ \fmConn -> - void $ sendDirectMessage fmConn (XGrpMemCon am.memberId) (GroupId groupId) + void $ sendDirectMessage fmConn (XGrpMemCon $ memberId (am :: GroupMember)) (GroupId groupId) else toView $ CRMessageError user "error" "saveGroupFwdRcvMsg: referenced author member id doesn't match message member id" throwError e _ -> throwError e @@ -5599,7 +5599,7 @@ saveRcvChatItem' user cd msg sharedMsgId_ brokerTs content ciFile itemTimed live (ciId, quotedItem) <- createNewRcvChatItem db user cd msg sharedMsgId_ content itemTimed live brokerTs createdAt forM_ ciFile $ \CIFile {fileId} -> updateFileTransferChatItemId db fileId ciId createdAt pure (ciId, quotedItem) - liftIO $ mkChatItem cd ciId content ciFile quotedItem sharedMsgId_ itemTimed live brokerTs msg.forwardedByGroupMemberId createdAt + liftIO $ mkChatItem cd ciId content ciFile quotedItem sharedMsgId_ itemTimed live brokerTs (forwardedByGroupMemberId (msg :: RcvMessage)) createdAt mkChatItem :: forall c d. MsgDirectionI d => ChatDirection c d -> ChatItemId -> CIContent d -> Maybe (CIFile d) -> Maybe (CIQuote c) -> Maybe SharedMsgId -> Maybe CITimed -> Bool -> ChatItemTs -> Maybe GroupMemberId -> UTCTime -> IO (ChatItem c d) mkChatItem cd ciId content file quotedItem sharedMsgId itemTimed live itemTs forwardedByGroupMemberId currentTs = do diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index 6361f7a6f7..d71ea80c82 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -354,7 +354,7 @@ createGroupInvitation db user@User {userId} contact@Contact {contactId, activeCo "INSERT INTO groups (group_profile_id, local_display_name, inv_queue_info, host_conn_custom_user_profile_id, user_id, enable_ntfs, created_at, updated_at, chat_ts) VALUES (?,?,?,?,?,?,?,?,?)" (profileId, localDisplayName, connRequest, customUserProfileId, userId, True, currentTs, currentTs, currentTs) insertedRowId db - let JVersionRange hostVRange = hostConn.peerChatVRange + let JVersionRange hostVRange = peerChatVRange hostConn GroupMember {groupMemberId} <- createContactMemberInv_ db user groupId Nothing contact fromMember GCHostMember GSMemInvited IBUnknown Nothing currentTs hostVRange membership <- createContactMemberInv_ db user groupId (Just groupMemberId) user invitedMember GCUserMember GSMemInvited (IBContact contactId) incognitoProfileId currentTs supportedChatVRange let chatSettings = ChatSettings {enableNtfs = MFAll, sendRcpts = Nothing, favorite = False} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 7918d68ffc..03c8d86c7a 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -488,7 +488,7 @@ viewChatItem chat ci@ChatItem {chatDir, meta = meta, content, quotedItem, file} withItemDeleted item = case chatItemDeletedText ci (chatInfoMembership chat) of Nothing -> item Just t -> item <> styled (colored Red) (" [" <> t <> "]") - withGroupMsgForwarded item = case meta.forwardedByGroupMemberId of + withGroupMsgForwarded item = case forwardedByGroupMemberId (meta :: CIMeta c d) of Nothing -> item Just _ -> item <> styled (colored Yellow) (" [>>]" :: String) withSndFile = withFile viewSentFileInvitation From 307a1b3c5e171ebcba566c1016a5e0adc75303c5 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:23:45 +0000 Subject: [PATCH 07/21] fix for ghc 8.10.7 --- simplex-chat.cabal | 14 +++++++------- src/Simplex/Chat.hs | 2 +- src/Simplex/Chat/Store/Files.hs | 3 +-- src/Simplex/Chat/Types.hs | 1 - src/Simplex/Chat/View.hs | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/simplex-chat.cabal b/simplex-chat.cabal index c3791ac11d..f238a99f34 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -186,7 +186,7 @@ library , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -238,7 +238,7 @@ executable simplex-bot , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -291,7 +291,7 @@ executable simplex-bot-advanced , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -346,7 +346,7 @@ executable simplex-broadcast-bot , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -400,7 +400,7 @@ executable simplex-chat , memory ==0.15.* , mtl ==2.2.* , network ==3.1.* - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -458,7 +458,7 @@ executable simplex-directory-service , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -542,7 +542,7 @@ test-suite simplex-chat-test , memory ==0.15.* , mtl ==2.2.* , network ==3.1.* - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index a1728b5dc7..bac065f7ac 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2247,7 +2247,7 @@ processChatCommand = \case forwardFile chatName fileId sendCommand = withUser $ \user -> do withStore (\db -> getFileTransfer db user fileId) >>= \case FTRcv RcvFileTransfer {fileStatus = RFSComplete RcvFileInfo {filePath}, cryptoArgs} -> forward filePath cryptoArgs - FTSnd {fileTransferMeta = FileTransferMeta {filePath, xftpSndFile}} -> forward filePath $ xftpSndFile >>= \f -> f.cryptoArgs + FTSnd {fileTransferMeta = FileTransferMeta {filePath, xftpSndFile}} -> forward filePath $ xftpSndFile >>= \XFTPSndFile {cryptoArgs} -> cryptoArgs _ -> throwChatError CEFileNotReceived {fileId} where forward path cfArgs = processChatCommand . sendCommand chatName $ CryptoFile path cfArgs diff --git a/src/Simplex/Chat/Store/Files.hs b/src/Simplex/Chat/Store/Files.hs index e3b1d44621..996a44b06f 100644 --- a/src/Simplex/Chat/Store/Files.hs +++ b/src/Simplex/Chat/Store/Files.hs @@ -2,7 +2,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -904,7 +903,7 @@ getLocalCryptoFile db userId fileId sent = _ -> do unless sent $ throwError $ SEFileNotFound fileId FileTransferMeta {filePath, xftpSndFile} <- getFileTransferMeta_ db userId fileId - pure $ CryptoFile filePath $ xftpSndFile >>= \f -> f.cryptoArgs + pure $ CryptoFile filePath $ xftpSndFile >>= \XFTPSndFile {cryptoArgs} -> cryptoArgs updateDirectCIFileStatus :: forall d. MsgDirectionI d => DB.Connection -> User -> Int64 -> CIFileStatus d -> ExceptT StoreError IO AChatItem updateDirectCIFileStatus db user fileId fileStatus = do diff --git a/src/Simplex/Chat/Types.hs b/src/Simplex/Chat/Types.hs index 34f2a4f108..ddeee38d88 100644 --- a/src/Simplex/Chat/Types.hs +++ b/src/Simplex/Chat/Types.hs @@ -9,7 +9,6 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 60d2a4cba6..314139f20c 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -487,7 +487,7 @@ viewGroupSubscribed :: GroupInfo -> [StyledString] viewGroupSubscribed g = [membershipIncognito g <> ttyFullGroup g <> ": connected to server(s)"] showSMPServer :: SMPServer -> String -showSMPServer srv = B.unpack $ strEncode srv.host +showSMPServer ProtocolServer {host} = B.unpack $ strEncode host viewHostEvent :: AProtocolType -> TransportHost -> String viewHostEvent p h = map toUpper (B.unpack $ strEncode p) <> " host " <> B.unpack (strEncode h) From 49a9b0e7d6ff48e2f5ca06165f0e0253ae383715 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:30:10 +0000 Subject: [PATCH 08/21] update hpack version --- simplex-chat.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplex-chat.cabal b/simplex-chat.cabal index f238a99f34..df38e71f4e 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack From 55ead740cc0d88ad2b6a22de350ea088d84747f3 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:34:25 +0000 Subject: [PATCH 09/21] update hpack --- simplex-chat.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplex-chat.cabal b/simplex-chat.cabal index df38e71f4e..bce79aeac5 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack From bd4259e89ef04e957f85d38d7d0cc5cd08d2ba97 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:34:25 +0000 Subject: [PATCH 10/21] update hpack --- simplex-chat.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplex-chat.cabal b/simplex-chat.cabal index df38e71f4e..bce79aeac5 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack From 4a311b9578d00c82e2bf3008887d7b5ac387582c Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:34:39 +0000 Subject: [PATCH 11/21] fix for ghc 8.10.7 --- src/Simplex/Chat/Store/Direct.hs | 1 - src/Simplex/Chat/Store/Groups.hs | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Simplex/Chat/Store/Direct.hs b/src/Simplex/Chat/Store/Direct.hs index 39d3cd8445..427a5842f7 100644 --- a/src/Simplex/Chat/Store/Direct.hs +++ b/src/Simplex/Chat/Store/Direct.hs @@ -2,7 +2,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index c63e702ca6..09aef8b910 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -2,7 +2,6 @@ {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} From 087acd91805d070876943867a8837afa66617ca4 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:29:49 +0000 Subject: [PATCH 12/21] changes to support GHC 8.10.7 (#3512) * Revert "raise lower bound on mtl to a real version (#3499)" This reverts commit f94c0311c115ec2127acc3f22ef928cb9ee0ad2f. * Revert "core: expand ranges to fit ghc 8.10 & 9.6 (#3496)" This reverts commit 9a1c7f41f770df72891c4fd6a3f459a9062bfd42. * update simplexmq * remove netword-transport fork * compatibility with GHC 8.10.7 * simplexmq * fix test * simplexmq, deps * update sqlcipher deps in sha256nix * fix index-state in cabal.project * index-state * remove import * add cabal.project.freeze * simplexmq * remove freeze * simplexmq * bytestring,simplexmq * template-haskell, simplexmq * simplexmq * simplexmq * simplexmq * mtl * simplexmq * remove duplicate index-state --- apps/simplex-bot-advanced/Main.hs | 2 +- apps/simplex-broadcast-bot/src/Broadcast/Bot.hs | 2 +- apps/simplex-chat/Server.hs | 1 + .../src/Directory/Service.hs | 2 +- cabal.project | 6 +++--- package.yaml | 2 +- scripts/nix/sha256map.nix | 4 ++-- simplex-chat.cabal | 14 +++++++------- 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 | 2 +- src/Simplex/Chat/Terminal/Input.hs | 1 + src/Simplex/Chat/Util.hs | 1 + tests/ChatClient.hs | 1 + 24 files changed, 39 insertions(+), 17 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 9205c0a4aa..777f094bc6 100644 --- a/cabal.project +++ b/cabal.project @@ -4,7 +4,7 @@ packages: . with-compiler: ghc-8.10.7 -index-state: 2023-10-20T00:00:00Z +index-state: 2023-10-06T00:00:00Z constraints: zip +disable-bzip2 +disable-zstd @@ -26,12 +26,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 diff --git a/package.yaml b/package.yaml index 2d1177354d..29b1be957f 100644 --- a/package.yaml +++ b/package.yaml @@ -22,7 +22,7 @@ dependencies: - 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.* diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 86eccf8863..b991461423 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -2,8 +2,8 @@ "https://github.com/simplex-chat/simplexmq.git"."eaf5317834b069144b5f4897f9c79831983e54dd" = "0jlic1q08mq9p9sgvigmc59r6x1r5fa1zsfqvvrwd97pwain36mj"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/kazu-yamamoto/http2.git"."f5525b755ff2418e6e6ecc69e877363b0d0bcaeb" = "0fyx0047gvhm99ilp212mmz37j84cwrfnpmssib5dw363fyb88b6"; - "https://github.com/simplex-chat/direct-sqlcipher.git"."34309410eb2069b029b8fc1872deb1e0db123294" = "0kwkmhyfsn2lixdlgl15smgr1h5gjk7fky6abzh8rng2h5ymnffd"; - "https://github.com/simplex-chat/sqlcipher-simple.git"."5e154a2aeccc33ead6c243ec07195ab673137221" = "1d1gc5wax4vqg0801ajsmx1sbwvd9y7p7b8mmskvqsmpbwgbh0m0"; + "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "0kiwhvml42g9anw4d2v0zd1fpc790pj9syg5x3ik4l97fnkbbwpp"; + "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; "https://github.com/simplex-chat/aeson.git"."aab7b5a14d6c5ea64c64dcaee418de1bb00dcc2b" = "0jz7kda8gai893vyvj96fy962ncv8dcsx71fbddyy8zrvc88jfrr"; "https://github.com/simplex-chat/haskell-terminal.git"."f708b00009b54890172068f168bf98508ffcd495" = "0zmq7lmfsk8m340g47g5963yba7i88n4afa6z93sg9px5jv1mijj"; "https://github.com/simplex-chat/android-support.git"."9aa09f148089d6752ce563b14c2df1895718d806" = "0pbf2pf13v2kjzi397nr13f1h3jv0imvsq8rpiyy2qyx5vd50pqn"; diff --git a/simplex-chat.cabal b/simplex-chat.cabal index bd067baeea..05e1f106d8 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -174,7 +174,7 @@ library , 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.* @@ -233,7 +233,7 @@ executable simplex-bot , 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.* @@ -293,7 +293,7 @@ executable simplex-bot-advanced , 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.* @@ -355,7 +355,7 @@ executable simplex-broadcast-bot , 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.* @@ -416,7 +416,7 @@ executable simplex-chat , 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.* @@ -481,7 +481,7 @@ executable simplex-directory-service , 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.* @@ -569,7 +569,7 @@ test-suite simplex-chat-test , 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.* 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 34f51989bc..c27675678e 100644 --- a/src/Simplex/Chat/Terminal.hs +++ b/src/Simplex/Chat/Terminal.hs @@ -5,7 +5,7 @@ module Simplex.Chat.Terminal where import Control.Exception (handle, throwIO) -import Control.Monad.Except +import Control.Monad import qualified Data.List.NonEmpty as L import Database.SQLite.Simple (SQLError (..)) import qualified Database.SQLite.Simple as DB 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 aba75ec847..824e6be0a0 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) From 8a66390a785a34226eabda8c54bfbc6e5f808bb6 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:14:56 +0000 Subject: [PATCH 13/21] fix for GHC 8.10.7 --- src/Simplex/Chat.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 807fbe38f1..27ac307e75 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -1994,7 +1994,7 @@ processChatCommand = \case DeleteRemoteCtrl rc -> withUser_ $ deleteRemoteCtrl rc >> ok_ QuitChat -> liftIO exitSuccess ShowVersion -> do - let versionInfo = coreVersionInfo $(simplexmqCommitQ) + let versionInfo = coreVersionInfo "" -- $(simplexmqCommitQ) chatMigrations <- map upMigration <$> withStore' (Migrations.getCurrent . DB.conn) agentMigrations <- withAgent getAgentMigrations pure $ CRVersionInfo {versionInfo, chatMigrations, agentMigrations} From aea7ff1c8980bb9c20944e004de05862419ceb96 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:27:58 +0000 Subject: [PATCH 14/21] nix: fix script --- scripts/nix/update-sha256.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nix/update-sha256.awk b/scripts/nix/update-sha256.awk index e432ec32d2..6ee0c9a155 100644 --- a/scripts/nix/update-sha256.awk +++ b/scripts/nix/update-sha256.awk @@ -11,7 +11,7 @@ BEGIN { /tag/ && isGit == true { ref=$2 } isGit == true && loc != "" && ref != "" { - cmd = "nix-prefetch-git --quiet "loc" "ref" | jq -r .sha256" + cmd = "nix-prefetch-git --fetch-submodules --quiet "loc" "ref" | jq -r .sha256" cmd | getline sha256 close(cmd) print " \""loc"\".\""ref"\" = \""sha256"\";"; From 4c6387c8540531b7e157e577568a3ef96204f16d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:27:58 +0000 Subject: [PATCH 15/21] nix: fix script --- scripts/nix/update-sha256.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nix/update-sha256.awk b/scripts/nix/update-sha256.awk index e432ec32d2..6ee0c9a155 100644 --- a/scripts/nix/update-sha256.awk +++ b/scripts/nix/update-sha256.awk @@ -11,7 +11,7 @@ BEGIN { /tag/ && isGit == true { ref=$2 } isGit == true && loc != "" && ref != "" { - cmd = "nix-prefetch-git --quiet "loc" "ref" | jq -r .sha256" + cmd = "nix-prefetch-git --fetch-submodules --quiet "loc" "ref" | jq -r .sha256" cmd | getline sha256 close(cmd) print " \""loc"\".\""ref"\" = \""sha256"\";"; From 545f110fb87a47703c5135929f08dbc03810a90c Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:29:36 +0000 Subject: [PATCH 16/21] nix: fix direct-sqlcipher content hash --- scripts/nix/sha256map.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index e34847138f..fc57b60045 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -2,7 +2,7 @@ "https://github.com/simplex-chat/simplexmq.git"."a860936072172e261480fa6bdd95203976e366b2" = "16rwnh5zzphmw8d8ypvps6xjvzbmf5ljr6zzy15gz2g0jyh7hd91"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/kazu-yamamoto/http2.git"."f5525b755ff2418e6e6ecc69e877363b0d0bcaeb" = "0fyx0047gvhm99ilp212mmz37j84cwrfnpmssib5dw363fyb88b6"; - "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "0kiwhvml42g9anw4d2v0zd1fpc790pj9syg5x3ik4l97fnkbbwpp"; + "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; "https://github.com/simplex-chat/aeson.git"."aab7b5a14d6c5ea64c64dcaee418de1bb00dcc2b" = "0jz7kda8gai893vyvj96fy962ncv8dcsx71fbddyy8zrvc88jfrr"; "https://github.com/simplex-chat/haskell-terminal.git"."f708b00009b54890172068f168bf98508ffcd495" = "0zmq7lmfsk8m340g47g5963yba7i88n4afa6z93sg9px5jv1mijj"; From dc8d10d068f729af4eeb4cb096de8bb5be889227 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:53:54 +0000 Subject: [PATCH 17/21] core: limit process package version to 1.6.17 --- package.yaml | 2 +- simplex-chat.cabal | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.yaml b/package.yaml index fa82f5a04c..4e117c706c 100644 --- a/package.yaml +++ b/package.yaml @@ -36,7 +36,7 @@ dependencies: - network >= 3.1.2.7 && < 3.2 - network-transport == 0.5.6 - optparse-applicative >= 0.15 && < 0.17 - - process == 1.6.* + - process >= 1.6 && < 1.6.18 - random >= 1.1 && < 1.3 - record-hasfield == 1.0.* - simple-logger == 0.1.* diff --git a/simplex-chat.cabal b/simplex-chat.cabal index f11660c571..50c1a40969 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -190,7 +190,7 @@ library , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -249,7 +249,7 @@ executable simplex-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -309,7 +309,7 @@ executable simplex-bot-advanced , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -371,7 +371,7 @@ executable simplex-broadcast-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -432,7 +432,7 @@ executable simplex-chat , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -498,7 +498,7 @@ executable simplex-directory-service , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -591,7 +591,7 @@ test-suite simplex-chat-test , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* + , process >=1.6 && <1.6.18 , random >=1.1 && <1.3 , record-hasfield ==1.0.* , silently ==1.2.* From 355d2449c5dca980f8bb09884b0fb6c9adf06cec Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 23 Dec 2023 15:05:36 +0000 Subject: [PATCH 18/21] fix for GHC 8.10.7 --- src/Simplex/Chat/Messages/Batch.hs | 1 - src/Simplex/Chat/Types/Preferences.hs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Simplex/Chat/Messages/Batch.hs b/src/Simplex/Chat/Messages/Batch.hs index 8b06873a33..3e3a1fd0b6 100644 --- a/src/Simplex/Chat/Messages/Batch.hs +++ b/src/Simplex/Chat/Messages/Batch.hs @@ -16,7 +16,6 @@ import Simplex.Chat.Controller (ChatError (..), ChatErrorType (..)) import Simplex.Chat.Messages data MsgBatch = MsgBatch Builder [SndMessage] - deriving (Show) -- | Batches [SndMessage] into batches of ByteString builders in form of JSON arrays. -- Does not check if the resulting batch is a valid JSON. diff --git a/src/Simplex/Chat/Types/Preferences.hs b/src/Simplex/Chat/Types/Preferences.hs index f4ad87f35c..5e1cd00a18 100644 --- a/src/Simplex/Chat/Types/Preferences.hs +++ b/src/Simplex/Chat/Types/Preferences.hs @@ -480,7 +480,7 @@ instance HasField "enable" FilesGroupPreference GroupFeatureEnabled where hasField p = (\enable -> p {enable}, enable (p :: FilesGroupPreference)) instance HasField "enable" HistoryGroupPreference GroupFeatureEnabled where - hasField p = (\enable -> p {enable}, p.enable) + hasField p = (\enable -> p {enable}, enable (p :: HistoryGroupPreference)) instance GroupFeatureI 'GFTimedMessages where type GroupFeaturePreference 'GFTimedMessages = TimedMessagesGroupPreference From ee75219ed3e6e190b8dab91235d771f9f9a0600b Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:57:05 +0000 Subject: [PATCH 19/21] core: 5.4.2.1 (simplexmq 5.5.0.2) --- cabal.project | 2 +- package.yaml | 2 +- scripts/nix/sha256map.nix | 2 +- simplex-chat.cabal | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index b891b954d1..baf7d5c4c1 100644 --- a/cabal.project +++ b/cabal.project @@ -14,7 +14,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 22e193237227ed4d243ec9cac8d8249f757d9601 + tag: d0588bd0ac23a459cbfc9a4789633014e91ffa19 source-repository-package type: git diff --git a/package.yaml b/package.yaml index 6964d9a883..4a7a2550fd 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: simplex-chat -version: 5.4.2.0 +version: 5.4.2.1 #synopsis: #description: homepage: https://github.com/simplex-chat/simplex-chat#readme diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index d5e66c0328..b22cef750e 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."22e193237227ed4d243ec9cac8d8249f757d9601" = "01h16jc0g5pqdq56k1n0afl2248ln2d11l662ikl6hdn3p3zab0d"; + "https://github.com/simplex-chat/simplexmq.git"."d0588bd0ac23a459cbfc9a4789633014e91ffa19" = "0b17qy74capb0jyli8f3pg1xi4aawhcgpmaz2ykl9g3605png1na"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/simplex-chat.cabal b/simplex-chat.cabal index 88c6dc5a9a..114c22f360 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: simplex-chat -version: 5.4.2.0 +version: 5.4.2.1 category: Web, System, Services, Cryptography homepage: https://github.com/simplex-chat/simplex-chat#readme author: simplex.chat From 7f8c7b2d991f80452946d70a0a5b32898e9583c3 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Wed, 24 Jan 2024 22:46:56 +0000 Subject: [PATCH 20/21] fix merge --- apps/ios/SimpleX.xcodeproj/project.pbxproj | 10 ---------- package.yaml | 4 ++-- simplex-chat.cabal | 16 ++++++++-------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/apps/ios/SimpleX.xcodeproj/project.pbxproj b/apps/ios/SimpleX.xcodeproj/project.pbxproj index 49b891ee82..6a51c873b3 100644 --- a/apps/ios/SimpleX.xcodeproj/project.pbxproj +++ b/apps/ios/SimpleX.xcodeproj/project.pbxproj @@ -164,11 +164,6 @@ 64466DC829FC2B3B00E3D48D /* CreateSimpleXAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64466DC729FC2B3B00E3D48D /* CreateSimpleXAddress.swift */; }; 64466DCC29FFE3E800E3D48D /* MailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64466DCB29FFE3E800E3D48D /* MailView.swift */; }; 6448BBB628FA9D56000D2AB9 /* GroupLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6448BBB528FA9D56000D2AB9 /* GroupLinkView.swift */; }; - 6449333A2AF8E51000AC506E /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 644933352AF8E51000AC506E /* libgmpxx.a */; }; - 6449333B2AF8E51000AC506E /* libgmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 644933362AF8E51000AC506E /* libgmp.a */; }; - 6449333C2AF8E51000AC506E /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 644933372AF8E51000AC506E /* libffi.a */; }; - 6449333D2AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8-ghc9.6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 644933382AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8-ghc9.6.3.a */; }; - 6449333E2AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 644933392AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8.a */; }; 644EFFDE292BCD9D00525D5B /* ComposeVoiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 644EFFDD292BCD9D00525D5B /* ComposeVoiceView.swift */; }; 644EFFE0292CFD7F00525D5B /* CIVoiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 644EFFDF292CFD7F00525D5B /* CIVoiceView.swift */; }; 644EFFE2292D089800525D5B /* FramedCIVoiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 644EFFE1292D089800525D5B /* FramedCIVoiceView.swift */; }; @@ -455,11 +450,6 @@ 64466DC729FC2B3B00E3D48D /* CreateSimpleXAddress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateSimpleXAddress.swift; sourceTree = ""; }; 64466DCB29FFE3E800E3D48D /* MailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailView.swift; sourceTree = ""; }; 6448BBB528FA9D56000D2AB9 /* GroupLinkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupLinkView.swift; sourceTree = ""; }; - 644933352AF8E51000AC506E /* libgmpxx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmpxx.a; sourceTree = ""; }; - 644933362AF8E51000AC506E /* libgmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmp.a; sourceTree = ""; }; - 644933372AF8E51000AC506E /* libffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libffi.a; sourceTree = ""; }; - 644933382AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8-ghc9.6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8-ghc9.6.3.a"; sourceTree = ""; }; - 644933392AF8E51000AC506E /* libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libHSsimplex-chat-5.4.0.3-EnhmkSQK6HvJ11g1uZERg8.a"; sourceTree = ""; }; 644EFFDD292BCD9D00525D5B /* ComposeVoiceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeVoiceView.swift; sourceTree = ""; }; 644EFFDF292CFD7F00525D5B /* CIVoiceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CIVoiceView.swift; sourceTree = ""; }; 644EFFE1292D089800525D5B /* FramedCIVoiceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FramedCIVoiceView.swift; sourceTree = ""; }; diff --git a/package.yaml b/package.yaml index 9eba9918ea..83daa6bd2e 100644 --- a/package.yaml +++ b/package.yaml @@ -36,7 +36,7 @@ dependencies: - network >= 3.1.2.7 && < 3.2 - network-transport == 0.5.6 - optparse-applicative >= 0.15 && < 0.17 - - process >= 1.6 && < 1.6.18 + - process == 1.6.* - random >= 1.1 && < 1.3 - record-hasfield == 1.0.* - simple-logger == 0.1.* @@ -131,7 +131,7 @@ tests: - async == 2.2.* - deepseq == 1.4.* - generic-random == 1.5.* - - hspec == 2.7.* + - hspec == 2.11.* - network == 3.1.* - silently == 1.2.* - stm == 2.5.* diff --git a/simplex-chat.cabal b/simplex-chat.cabal index b1fd924ae5..275a82ce7b 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -197,7 +197,7 @@ library , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -256,7 +256,7 @@ executable simplex-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -316,7 +316,7 @@ executable simplex-bot-advanced , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -378,7 +378,7 @@ executable simplex-broadcast-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -439,7 +439,7 @@ executable simplex-chat , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -505,7 +505,7 @@ executable simplex-directory-service , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -592,7 +592,7 @@ test-suite simplex-chat-test , exceptions ==0.10.* , filepath ==1.4.* , generic-random ==1.5.* - , hspec ==2.7.* + , hspec ==2.11.* , http-types ==0.12.* , http2 >=4.2.2 && <4.3 , memory ==0.18.* @@ -600,7 +600,7 @@ test-suite simplex-chat-test , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process >=1.6 && <1.6.18 + , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , silently ==1.2.* From 0d4d08e52b53465d732d58859cf1d0a366af13c6 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Tue, 30 Jan 2024 23:16:39 +0000 Subject: [PATCH 21/21] core: unify dependencies for GHC 8.10.7 and 9.6.3 (#3774) --- package.yaml | 11 +++++++++-- simplex-chat.cabal | 28 ++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/package.yaml b/package.yaml index 83daa6bd2e..88dbd639dd 100644 --- a/package.yaml +++ b/package.yaml @@ -36,7 +36,6 @@ dependencies: - network >= 3.1.2.7 && < 3.2 - network-transport == 0.5.6 - optparse-applicative >= 0.15 && < 0.17 - - process == 1.6.* - random >= 1.1 && < 1.3 - record-hasfield == 1.0.* - simple-logger == 0.1.* @@ -64,11 +63,13 @@ when: - condition: impl(ghc >= 9.6.2) dependencies: - bytestring == 0.11.* + - process == 1.6.* - template-haskell == 2.20.* - text >= 2.0.1 && < 2.2 - condition: impl(ghc < 9.6.2) dependencies: - bytestring == 0.10.* + - process >= 1.6 && < 1.6.18 - template-haskell == 2.16.* - text >= 1.2.3.0 && < 1.3 @@ -125,13 +126,19 @@ tests: - apps/simplex-broadcast-bot/src - apps/simplex-directory-service/src main: Test.hs + when: + - condition: impl(ghc >= 9.6.2) + dependencies: + - hspec == 2.11.* + - condition: impl(ghc < 9.6.2) + dependencies: + - hspec == 2.7.* dependencies: - QuickCheck == 2.14.* - simplex-chat - async == 2.2.* - deepseq == 1.4.* - generic-random == 1.5.* - - hspec == 2.11.* - network == 3.1.* - silently == 1.2.* - stm == 2.5.* diff --git a/simplex-chat.cabal b/simplex-chat.cabal index 275a82ce7b..d74d57523e 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -197,7 +197,6 @@ library , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -217,11 +216,13 @@ library if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -256,7 +257,6 @@ executable simplex-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -277,11 +277,13 @@ executable simplex-bot if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -316,7 +318,6 @@ executable simplex-bot-advanced , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -337,11 +338,13 @@ executable simplex-bot-advanced if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -378,7 +381,6 @@ executable simplex-broadcast-bot , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -399,11 +401,13 @@ executable simplex-broadcast-bot if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -439,7 +443,6 @@ executable simplex-chat , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -461,11 +464,13 @@ executable simplex-chat if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -505,7 +510,6 @@ executable simplex-directory-service , network >=3.1.2.7 && <3.2 , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , simple-logger ==0.1.* @@ -526,11 +530,13 @@ executable simplex-directory-service if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 @@ -592,7 +598,6 @@ test-suite simplex-chat-test , exceptions ==0.10.* , filepath ==1.4.* , generic-random ==1.5.* - , hspec ==2.11.* , http-types ==0.12.* , http2 >=4.2.2 && <4.3 , memory ==0.18.* @@ -600,7 +605,6 @@ test-suite simplex-chat-test , network ==3.1.* , network-transport ==0.5.6 , optparse-applicative >=0.15 && <0.17 - , process ==1.6.* , random >=1.1 && <1.3 , record-hasfield ==1.0.* , silently ==1.2.* @@ -622,10 +626,18 @@ test-suite simplex-chat-test if impl(ghc >= 9.6.2) build-depends: bytestring ==0.11.* + , process ==1.6.* , template-haskell ==2.20.* , text >=2.0.1 && <2.2 if impl(ghc < 9.6.2) build-depends: bytestring ==0.10.* + , process >=1.6 && <1.6.18 , template-haskell ==2.16.* , text >=1.2.3.0 && <1.3 + if impl(ghc >= 9.6.2) + build-depends: + hspec ==2.11.* + if impl(ghc < 9.6.2) + build-depends: + hspec ==2.7.*