mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-30 03:02:28 +00:00
use constraint to include simplexmq
This commit is contained in:
1 parent
fd6131a020
commit
f30f4a8606
9 files changed
+16
-14
No files matched your search
@@ -233,7 +233,7 @@ jobs:
|
||||
run: |
|
||||
cabal clean
|
||||
cabal update
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '-foptimize' || '' }}
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '--constraint "simplex-chat +optimize" --constraint "simplexmq +optimize"' || '' }}
|
||||
mkdir -p /out
|
||||
for i in simplex-chat simplex-chat-test; do
|
||||
bin=$(find /project/dist-newstyle -name "$i" -type f -executable)
|
||||
@@ -527,7 +527,7 @@ jobs:
|
||||
id: mac_cli_build
|
||||
shell: bash
|
||||
run: |
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '-foptimize' || '' }}
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '--constraint "simplex-chat +optimize" --constraint "simplexmq +optimize"' || '' }}
|
||||
path=$(cabal list-bin simplex-chat)
|
||||
echo "bin_path=$path" >> $GITHUB_OUTPUT
|
||||
echo "bin_hash=$(echo SHA2-256\(${{ matrix.cli_asset_name }}\)= $(openssl sha256 $path | cut -d' ' -f 2))" >> $GITHUB_OUTPUT
|
||||
@@ -575,7 +575,7 @@ jobs:
|
||||
attempts=1
|
||||
${{ (github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/tags/v')) }} && attempts=3
|
||||
while [ "$i" -le "$attempts" ]; do
|
||||
if cabal test --test-show-details=direct ${{ github.event_name != 'pull_request' && '-foptimize' || '' }}; then
|
||||
if cabal test --test-show-details=direct ${{ github.event_name != 'pull_request' && '--constraint "simplex-chat +optimize" --constraint "simplexmq +optimize"' || '' }}; then
|
||||
break
|
||||
else
|
||||
echo "Attempt $i failed, retrying..."
|
||||
@@ -654,7 +654,7 @@ jobs:
|
||||
|
||||
rm -rf dist-newstyle/src/direct-sq*
|
||||
sed -i "s/, unix /--, unix /" simplex-chat.cabal
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '-foptimize' || '' }}
|
||||
cabal build -j --enable-tests ${{ github.event_name != 'pull_request' && '--constraint "simplex-chat +optimize" --constraint "simplexmq +optimize"' || '' }}
|
||||
rm -rf dist-newstyle/src/direct-sq*
|
||||
path=$(cabal list-bin simplex-chat | tail -n 1)
|
||||
echo "bin_path=$path" >> $GITHUB_OUTPUT
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ RUN cp ./scripts/cabal.project.local.linux ./cabal.project.local
|
||||
|
||||
# Compile simplex-chat
|
||||
RUN cabal update
|
||||
RUN cabal build exe:simplex-chat --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library +optimize'
|
||||
RUN cabal build exe:simplex-chat --constraint 'simplexmq +client_library +optimize' --constraint 'simplex-chat +client_library +optimize'
|
||||
|
||||
# Strip the binary from debug symbols to reduce size
|
||||
RUN bin=$(find /project/dist-newstyle -name "simplex-chat" -type f -executable) && \
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ constraints: zip +disable-bzip2 +disable-zstd
|
||||
source-repository-package
|
||||
type: git
|
||||
location: https://github.com/simplex-chat/simplexmq.git
|
||||
tag: b981dcb70b8c99dc3733a99b6c1dc0d0ef83a3f7
|
||||
tag: 3dd2f746f5d6e8d9f55db2128745797364175fc6
|
||||
|
||||
source-repository-package
|
||||
type: git
|
||||
|
||||
@@ -52,9 +52,10 @@
|
||||
|
||||
({ ... }:
|
||||
{
|
||||
# Build simplex-chat with -O2 in all nix outputs (desktop, mobile, libs).
|
||||
# Build with -O2 in all nix outputs (desktop, mobile, libs).
|
||||
# The optimize flag defaults off (fast local/PR builds); nix always enables it.
|
||||
packages.simplex-chat.flags.optimize = true;
|
||||
packages.simplexmq.flags.optimize = true;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l);
|
||||
#rm -rf $BUILD_DIR
|
||||
if [[ "$DATABASE_BACKEND" == "postgres" ]]; then
|
||||
echo "Building with postgres backend..."
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -optl-Wl,-soname,libsimplex.so -flink-rts -threaded' --constraint 'simplexmq +client_library +client_postgres' --constraint 'simplex-chat +client_library +client_postgres +optimize'
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -optl-Wl,-soname,libsimplex.so -flink-rts -threaded' --constraint 'simplexmq +client_library +client_postgres +optimize' --constraint 'simplex-chat +client_library +client_postgres +optimize'
|
||||
else
|
||||
echo "Building with sqlite backend..."
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -optl-Wl,-soname,libsimplex.so -flink-rts -threaded' --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library +optimize'
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -optl-Wl,-soname,libsimplex.so -flink-rts -threaded' --constraint 'simplexmq +client_library +optimize' --constraint 'simplex-chat +client_library +optimize'
|
||||
fi
|
||||
cd $BUILD_DIR/build
|
||||
mv libHSsimplex-chat-*-inplace-ghc${GHC_VERSION}.so libsimplex.so 2> /dev/null || true
|
||||
|
||||
@@ -28,10 +28,10 @@ rm -rf $BUILD_DIR
|
||||
|
||||
if [[ "$DATABASE_BACKEND" == "postgres" ]]; then
|
||||
echo "Building with postgres backend..."
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-install_name,@rpath/$LIB -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library +client_postgres' --constraint 'simplex-chat +client_library +client_postgres +optimize'
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-install_name,@rpath/$LIB -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library +client_postgres +optimize' --constraint 'simplex-chat +client_library +client_postgres +optimize'
|
||||
else
|
||||
echo "Building with sqlite backend..."
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-install_name,@rpath/$LIB -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library +optimize'
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-install_name,@rpath/$LIB -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library +optimize' --constraint 'simplex-chat +client_library +optimize'
|
||||
fi
|
||||
|
||||
cd $BUILD_DIR/build
|
||||
|
||||
@@ -51,7 +51,7 @@ echo " ghc-options: -shared -threaded -optl-L$openssl_windows_style_path -opt
|
||||
# Very important! Without it the build fails on linking step since the linker can't find exported symbols.
|
||||
# It looks like GHC bug because with such random path the build ends successfully
|
||||
sed -i "s/ld.lld.exe/abracadabra.exe/" `ghc --print-libdir`/settings
|
||||
cabal build lib:simplex-chat --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library +optimize'
|
||||
cabal build lib:simplex-chat --constraint 'simplexmq +client_library +optimize' --constraint 'simplex-chat +client_library +optimize'
|
||||
|
||||
rm -rf apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||||
rm -rf apps/multiplatform/desktop/build/cmake
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"https://github.com/simplex-chat/simplexmq.git"."b981dcb70b8c99dc3733a99b6c1dc0d0ef83a3f7" = "0wpri01w30rd3wwzw630yngnj9fmyb7rschl3ic1cjd926vpg9b7";
|
||||
# NOTE: hash below is a PLACEHOLDER for the new simplexmq commit - run `update-sha256map` (in `nix develop`) to regenerate from cabal.project, or let `nix build` report the correct hash and paste it here.
|
||||
"https://github.com/simplex-chat/simplexmq.git"."3dd2f746f5d6e8d9f55db2128745797364175fc6" = "0000000000000000000000000000000000000000000000000000";
|
||||
"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";
|
||||
|
||||
@@ -80,7 +80,7 @@ for os_pair in ${oses}; do
|
||||
# CLI
|
||||
docker exec \
|
||||
-t "${container_name}" \
|
||||
sh -c 'cabal clean && cabal update && cabal build -j -foptimize && mkdir -p /out && for i in simplex-chat; do bin=$(find /project/dist-newstyle -name "$i" -type f -executable) && chmod +x "$bin" && mv "$bin" /out/; done && strip /out/simplex-chat'
|
||||
sh -c 'cabal clean && cabal update && cabal build -j --constraint "simplex-chat +optimize" --constraint "simplexmq +optimize" && mkdir -p /out && for i in simplex-chat; do bin=$(find /project/dist-newstyle -name "$i" -type f -executable) && chmod +x "$bin" && mv "$bin" /out/; done && strip /out/simplex-chat'
|
||||
|
||||
# Copy CLI
|
||||
docker cp \
|
||||
|
||||
Reference in new issue
Block a user