From 8ec8c451db15a10bc77621b2811186e750eb49b3 Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Sun, 11 Oct 2026 12:06:06 +0000 Subject: [PATCH 1/3] core: fix slow group membership lookup (#7688) --- .../Chat/Store/SQLite/Migrations/chat_query_plans.txt | 4 ++-- src/Simplex/Chat/Store/Shared.hs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt b/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt index de3088123c..433c2ec43f 100644 --- a/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt +++ b/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt @@ -5876,11 +5876,11 @@ Query: JOIN group_profiles gp ON gp.group_profile_id = g.group_profile_id JOIN group_members mu ON mu.group_id = g.group_id JOIN contact_profiles pu ON pu.contact_profile_id = COALESCE(mu.member_profile_id, mu.contact_profile_id) - WHERE g.group_id = ? AND g.user_id = ? AND mu.contact_id = ? + WHERE g.group_id = ? AND g.user_id = ? AND mu.user_id = ? AND mu.contact_id = ? Plan: SEARCH g USING INTEGER PRIMARY KEY (rowid=?) SEARCH gp USING INTEGER PRIMARY KEY (rowid=?) -SEARCH mu USING INDEX idx_group_members_contact_id (contact_id=?) +SEARCH mu USING INDEX idx_group_members_group_id (user_id=? AND group_id=?) SEARCH pu USING INTEGER PRIMARY KEY (rowid=?) Query: diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index 605d441eb4..75a49090ed 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -954,8 +954,9 @@ getGroupInfoRow db cxt User {userId, userContactId} groupId = ExceptT $ do firstRow (toGroupInfo currentTs cxt userContactId chatTags) (SEGroupNotFound groupId) $ DB.query db - (groupInfoQuery <> " WHERE g.group_id = ? AND g.user_id = ? AND mu.contact_id = ?") - (groupId, userId, userContactId) + -- mu.user_id steers the planner to idx_group_members_group_id; contact_id index is quadratic over all groups + (groupInfoQuery <> " WHERE g.group_id = ? AND g.user_id = ? AND mu.user_id = ? AND mu.contact_id = ?") + (groupId, userId, userId, userContactId) setPreparedGroupLinkInfo_ :: DB.Connection -> GroupInfo -> ConnReqContact -> ConnReqUriHash -> Maybe Int64 -> Maybe Int64 -> UTCTime -> IO () setPreparedGroupLinkInfo_ db GroupInfo {groupId, membership} cReq cReqHash customUserProfileId publicMemberCount_ currentTs = do From 64aa2825d5619111bb4d2baeb30cdc3337a7991e Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 11 Oct 2026 22:01:22 +0100 Subject: [PATCH 2/3] core: release core library to simplex-chat-libs every time cabal version changes (#7687) * core: release core library to simplex-chat-libs every time cabal version changes * implement * test build * update libs release * test library release * create release commit, so the date is correct * rework to create release in advance in maybe-release job * remove test build * move postgresql job back * test build * remove test build --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> --- .github/workflows/build.yml | 265 +++++++++++++------------ plans/2026-10-11-core-libs-releases.md | 182 +++++++++++++++++ scripts/desktop/build-lib-linux.sh | 2 +- scripts/desktop/build-lib-mac.sh | 2 +- scripts/desktop/build-lib-windows.sh | 2 +- 5 files changed, 328 insertions(+), 125 deletions(-) create mode 100644 plans/2026-10-11-core-libs-releases.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c20fce8c25..1acc26b6e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,10 +27,6 @@ on: - "scripts/desktop/**" - ".github/**" -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') }} - # This workflow uses custom actions (prepare-build and prepare-release) defined in: # # .github/actions/ @@ -70,14 +66,26 @@ jobs: # ============================= # Create release, but only if it's triggered by tag push. -# On pull requests/commits push, this job will always complete. +# Create simplex-chat-libs release core-, but only if the head commit of a push to master or stable changes the version in simplex-chat.cabal. +# On pull requests and other pushes, this job will always complete. + +# Secrets: +# ------- +# NODEJS_REPO_TOKEN +# Only select repositories: simplex-chat-libs +# Permissions: +# * Contents (Read and Write) maybe-release: runs-on: ubuntu-latest + outputs: + libs_tag: ${{ steps.libs_commit.outputs.tag }} steps: - name: Clone project - if: startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'push' uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Build changelog id: build_changelog @@ -103,6 +111,48 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check version change + id: check_version + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stable' + shell: bash + run: | + version=$(sed -n 's/^version: *//p' simplex-chat.cabal) + prev_version=$(git show HEAD^1:simplex-chat.cabal | sed -n 's/^version: *//p') + if [ "$version" != "$prev_version" ]; then + echo "version=$version" >> $GITHUB_OUTPUT + fi + + - name: Clone libs repo + if: steps.check_version.outputs.version + uses: actions/checkout@v3 + with: + repository: ${{ github.repository }}-libs + token: ${{ secrets.NODEJS_REPO_TOKEN }} + path: libs-repo + + - name: Commit and tag libs release + id: libs_commit + if: steps.check_version.outputs.version + working-directory: libs-repo + run: | + tag=core-${{ steps.check_version.outputs.version }} + printf 'version: %s\ncommit: %s\n' "${{ steps.check_version.outputs.version }}" "${{ github.sha }}" > core-release + git config user.name "SimpleX Chat" + git config user.email "build@simplex.chat" + git add core-release + git commit -m "$tag" + git tag "$tag" + git push --atomic origin HEAD "$tag" + echo "tag=$tag" >> $GITHUB_OUTPUT + + - name: Create libs release + if: steps.check_version.outputs.version + uses: softprops/action-gh-release@v2 + with: + repository: ${{ github.repository }}-libs + tag_name: ${{ steps.libs_commit.outputs.tag }} + token: ${{ secrets.NODEJS_REPO_TOKEN }} + # ========================= # Linux Build # ========================= @@ -111,6 +161,9 @@ jobs: name: "ubuntu-${{ matrix.os }}-${{ matrix.arch }} (CLI,Desktop), GHC: ${{ matrix.ghc }}" needs: [maybe-release, variables] runs-on: ${{ matrix.runner }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-linux-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-${{ needs.maybe-release.outputs.libs_tag }} + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') && !needs.maybe-release.outputs.libs_tag }} strategy: fail-fast: false matrix: @@ -129,6 +182,7 @@ jobs: should_run: true ghc: ${{ needs.variables.outputs.GHC_VER }} hash: 'sha256:5c8b2c0a6c745bc177669abfaa716b4bc57d58e2ea3882fb5da67f4d59e3dda5' + libs: true - os: 24.04 os_underscore: 24_04 arch: x86_64 @@ -143,6 +197,7 @@ jobs: should_run: true ghc: ${{ needs.variables.outputs.GHC_VER }} hash: 'sha256:6a62a4157b8775eaf4959cb629e757d32d39d1f4c8ac1b0ddc2510b555cf72f3' + libs: true - os: 24.04 os_underscore: 24_04 arch: aarch64 @@ -245,6 +300,25 @@ jobs: done strip /out/simplex-chat + - name: Build library + if: needs.maybe-release.outputs.libs_tag && matrix.libs + shell: docker exec -t builder sh -eu {0} + run: | + SKIP_VLC=1 scripts/desktop/build-lib-linux.sh + name=simplex-chat-libs-linux-${{ matrix.arch }} + mkdir -p release-libs/$name/libs + find apps/multiplatform/common/src/commonMain/cpp/desktop/libs/linux-${{ matrix.arch }} -maxdepth 1 -type f -exec cp {} release-libs/$name/libs/ \; + (cd release-libs/$name && zip -r ../$name.zip libs) + + - name: Upload library + if: needs.maybe-release.outputs.libs_tag && matrix.libs + uses: softprops/action-gh-release@v2 + with: + repository: ${{ github.repository }}-libs + tag_name: ${{ needs.maybe-release.outputs.libs_tag }} + files: release-libs/*.zip + token: ${{ secrets.NODEJS_REPO_TOKEN }} + - name: Build CLI deb if: startsWith(github.ref, 'refs/tags/v') && matrix.should_run == true shell: docker exec -t builder sh -eu {0} @@ -398,7 +472,7 @@ jobs: name: "ubuntu-22.04-x86_64 (Postgres lib), GHC: ${{ needs.variables.outputs.GHC_VER }}" needs: [maybe-release, variables] runs-on: ubuntu-22.04 - if: startsWith(github.ref, 'refs/tags/v') + if: needs.maybe-release.outputs.libs_tag steps: - name: Checkout Code uses: actions/checkout@v3 @@ -468,15 +542,18 @@ jobs: ARCH=x86_64 GHC_VER=${{ needs.variables.outputs.GHC_VER }} BUILD_DIR=$(echo dist-newstyle/build/${ARCH}-linux/ghc-${GHC_VER}/simplex-chat-*) - mkdir -p postgres-libs - cp ${BUILD_DIR}/build/libsimplex.so postgres-libs/ - cp ${BUILD_DIR}/build/deps/* postgres-libs/ + mkdir -p postgres-libs/libs + cp ${BUILD_DIR}/build/libsimplex.so postgres-libs/libs/ + cp ${BUILD_DIR}/build/deps/* postgres-libs/libs/ + (cd postgres-libs && zip -r simplex-chat-libs-linux-x86_64-postgres.zip libs) - - name: Upload postgres libs artifact - uses: actions/upload-artifact@v4 + - name: Upload postgres library + uses: softprops/action-gh-release@v2 with: - name: simplex-libs-linux-postgres-x86_64 - path: postgres-libs/ + repository: ${{ github.repository }}-libs + tag_name: ${{ needs.maybe-release.outputs.libs_tag }} + files: postgres-libs/*.zip + token: ${{ secrets.NODEJS_REPO_TOKEN }} - name: Fix permissions for cache shell: bash @@ -492,16 +569,21 @@ jobs: name: "${{ matrix.os }} (CLI,Desktop), GHC: ${{ matrix.ghc }}" needs: [maybe-release, variables] runs-on: ${{ matrix.os }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-macos-${{ matrix.os }}-${{ needs.maybe-release.outputs.libs_tag }} + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') && !needs.maybe-release.outputs.libs_tag }} strategy: fail-fast: false matrix: include: - os: macos-latest + arch: aarch64 ghc: ${{ needs.variables.outputs.GHC_VER }} cli_asset_name: simplex-chat-macos-aarch64 desktop_asset_name: simplex-desktop-macos-aarch64.dmg openssl_dir: "/opt/homebrew/opt" - os: macos-15-intel + arch: x86_64 ghc: ${{ needs.variables.outputs.GHC_VER }} cli_asset_name: simplex-chat-macos-x86-64 desktop_asset_name: simplex-desktop-macos-x86_64.dmg @@ -528,7 +610,7 @@ jobs: run: | echo "ignore-project: False" >> cabal.project.local echo "package simplexmq" >> cabal.project.local - echo " extra-include-dirs: ${{ matrix.opnessl_dir }}/openssl@3.0/include" >> cabal.project.local + echo " extra-include-dirs: ${{ matrix.openssl_dir }}/openssl@3.0/include" >> cabal.project.local echo " extra-lib-dirs: ${{ matrix.openssl_dir}}/openssl@3.0/lib" >> cabal.project.local echo "" >> cabal.project.local echo "package direct-sqlcipher" >> cabal.project.local @@ -601,6 +683,26 @@ jobs: exit 1 fi + - name: Build library + id: mac_lib_build + if: ${{ !cancelled() && needs.maybe-release.outputs.libs_tag && steps.mac_cli_build.outcome == 'success' }} + shell: bash + run: | + SKIP_VLC=1 scripts/desktop/build-lib-mac.sh + name=simplex-chat-libs-macos-${{ matrix.arch }} + mkdir -p release-libs/$name/libs + find apps/multiplatform/common/src/commonMain/cpp/desktop/libs/mac-${{ matrix.arch }} -maxdepth 1 -type f -exec cp {} release-libs/$name/libs/ \; + (cd release-libs/$name && zip -r ../$name.zip libs) + + - name: Upload library + if: ${{ !cancelled() && steps.mac_lib_build.outcome == 'success' }} + uses: softprops/action-gh-release@v2 + with: + repository: ${{ github.repository }}-libs + tag_name: ${{ needs.maybe-release.outputs.libs_tag }} + files: release-libs/*.zip + token: ${{ secrets.NODEJS_REPO_TOKEN }} + # ========================= # Windows Build # ========================= @@ -609,6 +711,9 @@ jobs: name: "${{ matrix.os }} (CLI,Desktop), GHC: ${{ matrix.ghc }}" needs: [maybe-release, variables] runs-on: ${{ matrix.os }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-windows-${{ matrix.os }}-${{ needs.maybe-release.outputs.libs_tag }} + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') && !needs.maybe-release.outputs.libs_tag }} strategy: fail-fast: false matrix: @@ -648,6 +753,7 @@ jobs: git perl make + zip pacboy: >- toolchain:p cmake:p @@ -676,6 +782,28 @@ jobs: 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 + - name: Build library + if: needs.maybe-release.outputs.libs_tag + shell: msys2 {0} + run: | + export PATH=$PATH:/c/ghcup/bin:$(echo /c/tools/ghc-*/bin || echo) + SKIP_VLC=1 scripts/desktop/build-lib-windows.sh + dlltool -d libsimplex.dll.def -l libsimplex.lib -D libsimplex.dll + name=simplex-chat-libs-windows-x86_64 + mkdir -p release-libs/$name/libs + find apps/multiplatform/common/src/commonMain/cpp/desktop/libs/windows-x86_64 -maxdepth 1 -type f -exec cp {} release-libs/$name/libs/ \; + cp libsimplex.lib release-libs/$name/libs/ + (cd release-libs/$name && zip -r ../$name.zip libs) + + - name: Upload library + if: needs.maybe-release.outputs.libs_tag + uses: softprops/action-gh-release@v2 + with: + repository: ${{ github.repository }}-libs + tag_name: ${{ needs.maybe-release.outputs.libs_tag }} + files: release-libs/*.zip + token: ${{ secrets.NODEJS_REPO_TOKEN }} + - name: Upload CLI if: startsWith(github.ref, 'refs/tags/v') uses: ./.github/actions/prepare-release @@ -709,110 +837,3 @@ jobs: bin_hash: ${{ steps.windows_desktop_build.outputs.package_hash }} github_ref: ${{ github.ref }} github_token: ${{ secrets.GITHUB_TOKEN }} - -# ========================= -# NodeJS libs release -# ========================= - -# Downloads Desktop builds, extracts and archives libraries for NodeJS addon. -# Depends on Linux/MacOS, executes only on release. - -# Secrets: -# ------- -# NODEJS_REPO_TOKEN -# Only select repositories: simplex-chat-libs -# Permissions: -# * Contents (Read and Write) - - release-nodejs-libs: - runs-on: ubuntu-latest - needs: [build-linux, build-linux-postgres, build-macos] - if: startsWith(github.ref, 'refs/tags/v') && (!cancelled()) - steps: - - name: Checkout current repository - uses: actions/checkout@v6 - - - name: Install packages for archiving - run: sudo apt install -y msitools gcc-mingw-w64 - - - name: Download postgres libs artifact - if: needs.build-linux-postgres.result == 'success' - uses: actions/download-artifact@v4 - with: - name: simplex-libs-linux-postgres-x86_64 - path: ${{ runner.temp }}/postgres-libs - - - name: Build archives - run: | - INIT_DIR='${{ runner.temp }}/artifacts' - RELEASE_DIR='${{ runner.temp }}/release-assets' - TAG='${{ github.ref_name }}' - URL='https://github.com/${{ github.repository }}/releases/download' - PREFIX='${{ github.event.repository.name }}-libs' - # Windows-specific - FILE_URL='https://raw.githubusercontent.com/${{ github.repository }}/refs/tags/${{ github.ref_name }}' - - # Setup directories - mkdir "$INIT_DIR" "$RELEASE_DIR" && cd "$INIT_DIR" - - # Downlaod desktop release - curl --proto '=https' --tlsv1.2 -sSf -L "${URL}/${TAG}/simplex-desktop-ubuntu-22_04-x86_64.deb" -o linux.deb - curl --proto '=https' --tlsv1.2 -sSf -L "${URL}/${TAG}/simplex-desktop-macos-aarch64.dmg" -o macos-aarch64.dmg - curl --proto '=https' --tlsv1.2 -sSf -L "${URL}/${TAG}/simplex-desktop-macos-x86_64.dmg" -o macos-x86_64.dmg - curl --proto '=https' --tlsv1.2 -sSf -L "${URL}/${TAG}/simplex-desktop-windows-x86_64.msi" -o windows-x86_64.msi - - # Linux - # ----- - # Extract libraries - dpkg-deb -R linux.deb linux-out/ && cd linux-out/opt/simplex/lib/app/resources - # Preprare directory - mkdir libs && cp *.so libs/ - # Archive - zip -r "${PREFIX}-linux-x86_64.zip" libs - # Back to original dir - mv "${PREFIX}-linux-x86_64.zip" "$RELEASE_DIR" && cd "$INIT_DIR" - - # MacOS: aarch64 - # -------------- - 7z x macos-aarch64.dmg -omacos1-out/ && cd macos1-out/SimpleX/SimpleX.app/Contents/app/resources/ - mkdir libs && cp *.dylib libs/ - zip -r "${PREFIX}-macos-aarch64.zip" libs - mv "${PREFIX}-macos-aarch64.zip" "$RELEASE_DIR" && cd "$INIT_DIR" - - # Macos: x86_64 - # ------------- - 7z x macos-x86_64.dmg -omacos2-out/ && cd macos2-out/SimpleX/SimpleX.app/Contents/app/resources/ - mkdir libs && cp *.dylib libs/ - zip -r "${PREFIX}-macos-x86_64.zip" libs - mv "${PREFIX}-macos-x86_64.zip" "$RELEASE_DIR" && cd "$INIT_DIR" - - # Windows: x86_64 - # --------------- - msiextract windows-x86_64.msi -C windows-out && cd windows-out/SimpleX/app/resources - - # We need to generate library that exports symbols from Windows dll - curl --proto '=https' --tlsv1.2 -sSf -LO "${FILE_URL}/libsimplex.dll.def" - x86_64-w64-mingw32-dlltool -d libsimplex.dll.def -l libsimplex.lib -D libsimplex.dll - - mkdir libs && cp *.dll *.lib libs/ - zip -r "${PREFIX}-windows-x86_64.zip" libs - mv "${PREFIX}-windows-x86_64.zip" "$RELEASE_DIR" && cd "$INIT_DIR" - - # Linux PostgreSQL (only if postgres build succeeded) - # ------------------------------------------------- - POSTGRES_LIBS='${{ runner.temp }}/postgres-libs' - if [ -d "$POSTGRES_LIBS" ]; then - mkdir -p linux-postgres/libs - cp "${POSTGRES_LIBS}"/*.so linux-postgres/libs/ - cd linux-postgres - zip -r "${PREFIX}-linux-x86_64-postgres.zip" libs - mv "${PREFIX}-linux-x86_64-postgres.zip" "$RELEASE_DIR" && cd "$INIT_DIR" - fi - - - name: Create release in libs repo and upload artifacts - uses: softprops/action-gh-release@v2 - with: - repository: ${{ github.repository }}-libs - tag_name: ${{ github.ref_name }} - files: ${{ runner.temp }}/release-assets/* - token: ${{ secrets.NODEJS_REPO_TOKEN }} diff --git a/plans/2026-10-11-core-libs-releases.md b/plans/2026-10-11-core-libs-releases.md new file mode 100644 index 0000000000..e6f9a1347b --- /dev/null +++ b/plans/2026-10-11-core-libs-releases.md @@ -0,0 +1,182 @@ +# Core library releases: implementation plan + +Libraries for the Node.js package are released per core version, from the commit on `master` or `stable` that changes the version. + +## 1. Release identity + +``` +repository simplex-chat/simplex-chat-libs +tag core- +version version: field of simplex-chat.cabal, e.g. 7.1.0.10 +build push to master or stable, head commit changes version: compared with its first parent +source the head commit of that push +``` + +A version change that is not the head commit of its push is not released. + +Rule: a core version is final once a published package depends on it. +Its migrations and chat protocol versions stay unchanged. +A further change requires a new cabal version. + +## 2. Assets + +| Asset | Job | Backend | +|---|---|---| +| `simplex-chat-libs-linux-x86_64.zip` | `build-linux`, 22.04 x86_64 | sqlite | +| `simplex-chat-libs-linux-x86_64-postgres.zip` | `build-linux-postgres` | postgres | +| `simplex-chat-libs-linux-aarch64.zip` | `build-linux`, 22.04 aarch64 | sqlite | +| `simplex-chat-libs-macos-aarch64.zip` | `build-macos`, `macos-latest` | sqlite | +| `simplex-chat-libs-macos-x86_64.zip` | `build-macos`, `macos-15-intel` | sqlite | +| `simplex-chat-libs-windows-x86_64.zip` | `build-windows` | sqlite | + +Zip content: directory `libs/` with the top-level files of `apps/multiplatform/common/src/commonMain/cpp/desktop/libs/-/`. +Windows zip: also `libs/libsimplex.lib`. +Asset names: as built by `download-libs.js` (line 123). +Checksums: `digest` (sha256) of each asset in the GitHub release API. + +## 3. `build.yml` + +### 3.1. `maybe-release` + +The release is created before the build jobs; each build job uploads its assets, as for `v*` tags. + +``` +outputs libs_tag: tag of the created library release, empty otherwise +Clone project condition: push event; fetch-depth: 2 +``` + +Steps after "Create release": + +| Step | Condition | Action | +|---|---|---| +| Check version change | ref `master` or `stable` | output `version` when `version:` of `simplex-chat.cabal` differs from `HEAD^1:simplex-chat.cabal` | +| Clone libs repo | `version` set | checkout of simplex-chat-libs to `libs-repo`, token `NODEJS_REPO_TOKEN` | +| Commit and tag libs release | `version` set | commit and tag below; `git push --atomic origin HEAD `; output `tag` | +| Create libs release | `version` set | `softprops/action-gh-release@v2`, repository simplex-chat-libs, `tag_name` = `tag`, without files | + +Commit in simplex-chat-libs: + +``` +file core-release +content version: + commit: +author SimpleX Chat +message core- +tag core-, on this commit +``` + +`NODEJS_REPO_TOKEN`: a token of the build account; releases are attributed to the token owner. +Secrets comment: above `maybe-release`. + +A failure of `maybe-release` skips the build jobs, as for `v*` tags. + +### 3.2. Concurrency + +Workflow-level `concurrency`: removed. + +Job-level `concurrency` in `build-linux`, `build-macos`, `build-windows`: + +``` +group ${{ github.workflow }}-${{ github.ref }}---${{ needs.maybe-release.outputs.libs_tag }} +cancel-in-progress not a v* tag and libs_tag empty +``` + +Library release runs are never cancelled; other runs are cancelled by the next push to the same ref. + +### 3.3. Library steps + +| Job | Entries | Position | Build | +|---|---|---|---| +| `build-linux` | 22.04 x86_64 and 22.04 aarch64, GHC 9.6.3 (matrix key `libs: true`) | after "Build CLI" | `SKIP_VLC=1 scripts/desktop/build-lib-linux.sh` | +| `build-macos` | both (matrix key `arch`) | after "Run tests" | `SKIP_VLC=1 scripts/desktop/build-lib-mac.sh` | +| `build-windows` | `windows-latest` | after "Build CLI" | `SKIP_VLC=1 scripts/desktop/build-lib-windows.sh`; `dlltool -d libsimplex.dll.def -l libsimplex.lib -D libsimplex.dll` | + +Each build step: staging in `release-libs//libs/`, then `zip -r` to `release-libs/.zip`. +Linux steps run in the build container. +Windows: `zip` added to the MSYS2 `install` list. + +Upload step, after the build steps of the job: + +``` +action softprops/action-gh-release@v2 +repository ${{ github.repository }}-libs +tag_name needs.maybe-release.outputs.libs_tag +files release-libs/*.zip +token secrets.NODEJS_REPO_TOKEN +``` + +Conditions: + +| Job | Build | Upload | +|---|---|---| +| `build-linux` | `libs_tag` set, `matrix.libs` | `libs_tag` set, `matrix.libs` | +| `build-macos` | `!cancelled()`, `libs_tag` set, CLI build succeeded | `!cancelled()`, library build succeeded | +| `build-windows` | `libs_tag` set | `libs_tag` set | + +A failed job leaves its assets absent; the other jobs upload theirs. +A re-run of a failed job uploads its assets to the same release; an asset of the same name is replaced. + +### 3.4. `build-linux-postgres` + +Edits of the existing job: + +``` +if needs.maybe-release.outputs.libs_tag, replaces the v* tag condition +Copy libs from container + files copied to postgres-libs/libs/ + zip -r simplex-chat-libs-linux-x86_64-postgres.zip libs, in postgres-libs +Upload postgres library + replaces the artifact upload + softprops/action-gh-release@v2, files postgres-libs/*.zip, other inputs as in 3.3 +``` + +## 4. Scripts: `SKIP_VLC` + +With `SKIP_VLC` set, the VLC download is skipped. +Unset: unchanged. + +| File | Line | After | +|---|---|---| +| `scripts/desktop/build-lib-linux.sh` | 56 | `[ -n "$SKIP_VLC" ] \|\| scripts/desktop/prepare-vlc-linux.sh` | +| `scripts/desktop/build-lib-mac.sh` | 154 | `[ -n "$SKIP_VLC" ] \|\| scripts/desktop/prepare-vlc-mac.sh` | +| `scripts/desktop/build-lib-windows.sh` | 64 | `[ -n "$SKIP_VLC" ] \|\| scripts/desktop/prepare-vlc-windows.sh` | + +## 5. `build.yml`: removed job + +`release-nodejs-libs`, with its header comment. + +## 6. Node.js package + +``` +download-libs.js RELEASE_TAG = 'core-', set in the Node.js release commit, once release core- exists +package.json version: Node.js release cycle +release commits RELEASE_TAG removed from their edits (author build@simplex.chat) +``` + +This change: `RELEASE_TAG` unchanged, `'v7.1.0-beta.6'`. + +Platforms: `linux-aarch64` added by the assets in section 2; `download-libs.js` maps `arm64` to `aarch64` (lines 46-50). +Postgres: Linux x86_64 only (lines 19-22). + +## 7. Precompiled add-on (`ep/node-add-on`) + +Add-on releases: separate from library releases, triggered by changes of the Node.js package version, designed in `ep/node-add-on`. + +Effects of this plan on `ep/node-add-on`: + +``` +release-nodejs-libs removed; its add-on upload edits move to the add-on release +RELEASE_TAG library release core-; add-on assets in a separate release +SHA256 library values from the asset digests of release core- +``` + +## 8. `build.yml` fix + +Line 531: `matrix.opnessl_dir` → `matrix.openssl_dir`. + +## 9. Verification + +1. Branch run of `build.yml` with temporary edits: `push` trigger and "Check version change" condition with the branch, tag `core-test-`, cabal version increment in the head commit of the push. +2. `npm install` of the Node.js package with `RELEASE_TAG = 'core-test-'` on Linux x86_64, Linux aarch64, macOS aarch64, macOS x86_64, Windows x86_64. +3. Postgres: `SIMPLEX_BACKEND=postgres npm install` on Linux x86_64. +4. Release `core-test-` and its tag deleted after verification. diff --git a/scripts/desktop/build-lib-linux.sh b/scripts/desktop/build-lib-linux.sh index a2684b87d2..6ee419c5a8 100755 --- a/scripts/desktop/build-lib-linux.sh +++ b/scripts/desktop/build-lib-linux.sh @@ -53,7 +53,7 @@ rm -rf apps/multiplatform/desktop/build/cmake mkdir -p apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ cp -r $BUILD_DIR/build/deps/* apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ cp $BUILD_DIR/build/libsimplex.so apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ -scripts/desktop/prepare-vlc-linux.sh +[ -n "$SKIP_VLC" ] || scripts/desktop/prepare-vlc-linux.sh links_dir=apps/multiplatform/build/links mkdir -p $links_dir diff --git a/scripts/desktop/build-lib-mac.sh b/scripts/desktop/build-lib-mac.sh index 6013fc55c0..5563086c29 100755 --- a/scripts/desktop/build-lib-mac.sh +++ b/scripts/desktop/build-lib-mac.sh @@ -151,7 +151,7 @@ if [ -n "$LOCAL_DIRS" ]; then fi cd - -scripts/desktop/prepare-vlc-mac.sh +[ -n "$SKIP_VLC" ] || scripts/desktop/prepare-vlc-mac.sh links_dir=apps/multiplatform/build/links mkdir -p $links_dir diff --git a/scripts/desktop/build-lib-windows.sh b/scripts/desktop/build-lib-windows.sh index fdf7154491..15e021adf7 100755 --- a/scripts/desktop/build-lib-windows.sh +++ b/scripts/desktop/build-lib-windows.sh @@ -61,7 +61,7 @@ mkdir -p apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ cp dist-newstyle/openssl-3.0.15/libcrypto-3-x64.dll apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ cp libsimplex.dll apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/ -scripts/desktop/prepare-vlc-windows.sh +[ -n "$SKIP_VLC" ] || scripts/desktop/prepare-vlc-windows.sh links_dir=apps/multiplatform/build/links mkdir -p $links_dir From 9711dcfc9c39ba125c1fb1674a3e039b1b9c0e81 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Sun, 11 Oct 2026 23:01:35 +0100 Subject: [PATCH 3/3] core: 7.1.0.11 (simplexmq 7.1.0.11) --- cabal.project | 2 +- scripts/nix/sha256map.nix | 2 +- simplex-chat.cabal | 2 +- src/Simplex/Chat/Remote.hs | 4 ++-- tests/ChatClient.hs | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 9d5f1b8e21..fea595d685 100644 --- a/cabal.project +++ b/cabal.project @@ -21,7 +21,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: a2f985dc68f870c0327fc3e871f2816828bcba2d + tag: cba13823567d7cd564d8a1f354046174fba375d8 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 43573e82cf..49ae96bb8f 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."a2f985dc68f870c0327fc3e871f2816828bcba2d" = "12a66936nliggq8k2pmk8x2lilrhvlg15rsmcv556s8gpzxjavdw"; + "https://github.com/simplex-chat/simplexmq.git"."cba13823567d7cd564d8a1f354046174fba375d8" = "0nhd6zsmqs55b7shh945b0v9pn0qqkpx9djq9dldair82hsmw1if"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."2330df3dc8c4b660674d3c02d76bb86f66c2abee" = "11pfj1vqsjdl26nplkr2l6z1xj7cn153qijj5gknmlzq3krn7x1i"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/simplex-chat.cabal b/simplex-chat.cabal index 0348469060..c9a29b3ac8 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: 7.1.0.10 +version: 7.1.0.11 category: Web, System, Services, Cryptography homepage: https://github.com/simplex-chat/simplex-chat#readme author: simplex.chat diff --git a/src/Simplex/Chat/Remote.hs b/src/Simplex/Chat/Remote.hs index 35e9d6d372..63886dcadb 100644 --- a/src/Simplex/Chat/Remote.hs +++ b/src/Simplex/Chat/Remote.hs @@ -75,11 +75,11 @@ remoteFilesFolder = "simplex_v1_files" -- when acting as host minRemoteCtrlVersion :: AppVersion -minRemoteCtrlVersion = AppVersion [7, 1, 0, 9] +minRemoteCtrlVersion = AppVersion [7, 1, 0, 11] -- when acting as controller minRemoteHostVersion :: AppVersion -minRemoteHostVersion = AppVersion [7, 1, 0, 9] +minRemoteHostVersion = AppVersion [7, 1, 0, 11] currentAppVersion :: AppVersion currentAppVersion = AppVersion SC.version diff --git a/tests/ChatClient.hs b/tests/ChatClient.hs index 4a052d7da5..0593dc3554 100644 --- a/tests/ChatClient.hs +++ b/tests/ChatClient.hs @@ -670,6 +670,7 @@ smpServerCfg p = prometheusInterval = Nothing, prometheusMetricsFile = "tests/smp-server-metrics.txt", pendingENDInterval = 500000, + authErrorDelay = 10, ntfDeliveryInterval = 200000, smpServerVRange = supportedServerSMPRelayVRange, transportConfig = mkTransportServerConfig True (Just alpnSupportedSMPHandshakes) True,