From 0a6c464a8d8c911b9f76691e8cac59607f4c9683 Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:58:30 +0700 Subject: [PATCH 1/4] desktop (windows): added a missing symbol to lib build (#3778) --- flake.nix | 2 ++ libsimplex.dll.def | 1 + 2 files changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index 6fabe7d657..91cf43d0fe 100644 --- a/flake.nix +++ b/flake.nix @@ -385,6 +385,7 @@ "chat_send_cmd" "chat_send_remote_cmd" "chat_valid_name" + "chat_json_length" "chat_write_file" ]; postInstall = '' @@ -487,6 +488,7 @@ "chat_send_cmd" "chat_send_remote_cmd" "chat_valid_name" + "chat_json_length" "chat_write_file" ]; postInstall = '' diff --git a/libsimplex.dll.def b/libsimplex.dll.def index f927e3ee24..592e6db4f2 100644 --- a/libsimplex.dll.def +++ b/libsimplex.dll.def @@ -12,6 +12,7 @@ EXPORTS chat_parse_server chat_password_hash chat_valid_name + chat_json_length chat_encrypt_media chat_decrypt_media chat_write_file From 5ad356172fbe2d859da03d2232d81674ea692c2e Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:47:10 +0700 Subject: [PATCH 2/4] scripts: check that all symbols were exported (#3779) * scripts: check that all symbols were exported * changes * windows --------- Co-authored-by: Avently --- scripts/desktop/build-lib-linux.sh | 4 ++++ scripts/desktop/build-lib-mac.sh | 4 ++++ scripts/desktop/build-lib-windows.sh | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/scripts/desktop/build-lib-linux.sh b/scripts/desktop/build-lib-linux.sh index fa1f892a03..c27b672e40 100755 --- a/scripts/desktop/build-lib-linux.sh +++ b/scripts/desktop/build-lib-linux.sh @@ -20,6 +20,10 @@ root_dir="$(dirname "$(dirname "$(readlink "$0")")")" cd $root_dir BUILD_DIR=dist-newstyle/build/$ARCH-$OS/ghc-${GHC_VERSION}/simplex-chat-* +exports=( $(sed 's/foreign export ccall "chat_migrate_init_key"//' src/Simplex/Chat/Mobile.hs | sed 's/foreign export ccall "chat_reopen_store"//' |grep "foreign export ccall" | cut -d '"' -f2) ) +for elem in "${exports[@]}"; do count=$(grep -R "$elem$" libsimplex.dll.def | wc -l); if [ $count -ne 1 ]; then echo Wrong exports in libsimplex.dll.def. Add \"$elem\" to that file; exit 1; fi ; done +for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l); if [ $count -ne 2 ]; then echo Wrong exports in flake.nix. Add \"$elem\" in two places of the file; exit 1; fi ; done + rm -rf $BUILD_DIR cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -flink-rts -threaded' cd $BUILD_DIR/build diff --git a/scripts/desktop/build-lib-mac.sh b/scripts/desktop/build-lib-mac.sh index 55e5ca6f3a..2b0fd5376f 100755 --- a/scripts/desktop/build-lib-mac.sh +++ b/scripts/desktop/build-lib-mac.sh @@ -19,6 +19,10 @@ GHC_LIBS_DIR=$(ghc --print-libdir) BUILD_DIR=dist-newstyle/build/$ARCH-*/ghc-*/simplex-chat-* +exports=( $(sed 's/foreign export ccall "chat_migrate_init_key"//' src/Simplex/Chat/Mobile.hs | sed 's/foreign export ccall "chat_reopen_store"//' |grep "foreign export ccall" | cut -d '"' -f2) ) +for elem in "${exports[@]}"; do count=$(grep -R "$elem$" libsimplex.dll.def | wc -l); if [ $count -ne 1 ]; then echo Wrong exports in libsimplex.dll.def. Add \"$elem\" to that file; exit 1; fi ; done +for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l); if [ $count -ne 2 ]; then echo Wrong exports in flake.nix. Add \"$elem\" in two places of the file; exit 1; fi ; done + rm -rf $BUILD_DIR cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" diff --git a/scripts/desktop/build-lib-windows.sh b/scripts/desktop/build-lib-windows.sh index bd2cdc1c23..72de53854f 100755 --- a/scripts/desktop/build-lib-windows.sh +++ b/scripts/desktop/build-lib-windows.sh @@ -17,6 +17,10 @@ fi BUILD_DIR=dist-newstyle/build/$ARCH-$OS/ghc-*/simplex-chat-* +exports=( $(sed 's/foreign export ccall "chat_migrate_init_key"//' src/Simplex/Chat/Mobile.hs | sed 's/foreign export ccall "chat_reopen_store"//' |grep "foreign export ccall" | cut -d '"' -f2) ) +for elem in "${exports[@]}"; do count=$(grep -R "$elem$" libsimplex.dll.def | wc -l); if [ $count -ne 1 ]; then echo Wrong exports in libsimplex.dll.def. Add \"$elem\" to that file; exit 1; fi ; done +for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l); if [ $count -ne 2 ]; then echo Wrong exports in flake.nix. Add \"$elem\" in two places of the file; exit 1; fi ; done + # IMPORTANT: in order to get a working build you should use x86_64 MinGW with make, cmake, gcc. # 100% working MinGW is https://github.com/brechtsanders/winlibs_mingw/releases/download/13.1.0-16.0.5-11.0.0-ucrt-r5/winlibs-x86_64-posix-seh-gcc-13.1.0-mingw-w64ucrt-11.0.0-r5.zip # Many other distributions I tested don't work in some cases or don't have required tools. From c6f4d62d6ca6d3bccf1ad09a851aa216edfe6dfc Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Thu, 1 Feb 2024 16:36:32 +0000 Subject: [PATCH 3/4] core: update simplexmq (fix socket/memory leak on resubscriptions) --- cabal.project | 2 +- scripts/nix/sha256map.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 0c6105ab2b..46d32d7056 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 7a0cd8041bbb7d7ab2f089395a244dc4af0f9e3b + tag: 2ae1c9f79dad453421c3ddf92200ff07a4080558 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 53bd19a368..c68d22f693 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."7a0cd8041bbb7d7ab2f089395a244dc4af0f9e3b" = "0jxf9dnsg14ffd1y3i7md2ninrds4daq1fmpnd6j5z99im07ns52"; + "https://github.com/simplex-chat/simplexmq.git"."2ae1c9f79dad453421c3ddf92200ff07a4080558" = "0klfwjv27va58g23bzly2smqfj05snib75hab8232z6zb7yl0yi7"; "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"; From 3a879b755b16f74fb768fe1831c80647ec34b664 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 2 Feb 2024 08:30:26 +0000 Subject: [PATCH 4/4] core: 5.5.2.0 (simplexmq 5.5.1.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 46d32d7056..780703f012 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 2ae1c9f79dad453421c3ddf92200ff07a4080558 + tag: a516c2f72c81bb4a433c4065b1b5aa484b8292b1 source-repository-package type: git diff --git a/package.yaml b/package.yaml index 59d52b6f67..afbd93629e 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: simplex-chat -version: 5.5.1.0 +version: 5.5.2.0 #synopsis: #description: homepage: https://github.com/simplex-chat/simplex-chat#readme diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index c68d22f693..042c455b09 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."2ae1c9f79dad453421c3ddf92200ff07a4080558" = "0klfwjv27va58g23bzly2smqfj05snib75hab8232z6zb7yl0yi7"; + "https://github.com/simplex-chat/simplexmq.git"."a516c2f72c81bb4a433c4065b1b5aa484b8292b1" = "05ny2i262c236li5w040i1nd3l037cpzgbzjknlla9dd139f3al3"; "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 cd010a0eec..edc65a6dfb 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.5.1.0 +version: 5.5.2.0 category: Web, System, Services, Cryptography homepage: https://github.com/simplex-chat/simplex-chat#readme author: simplex.chat