Files
simplex-chat/scripts/ci/desktop-linux/build-core.sh
T
spacedandy-agents-simplex 86358ba5bc ci: build the desktop app for Linux, run a UI smoke test under Xvfb and the desktop tests
First iteration on f/ci-desktop: the core job builds libsimplex.so with scripts/desktop/build-lib-linux.sh on ubuntu-24.04 (GHC 9.6.3, direct-sqlcipher +openssl, no VLC) and caches it by source hash, with the cabal store cached separately. The app job builds :desktop:createDistributable with Corretto 17 and the repo's assets, runs :common:desktopTest, then starts the app under Xvfb and openbox with software rendering and drives onboarding to the chat list and typing in the search field with the ui helper (xdotool input, tesseract OCR to find text), saving numbered screenshots, the text read from them and a step log as artifacts.
2026-10-14 17:33:34 +00:00

40 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Builds the desktop core library for Linux with scripts/desktop/build-lib-linux.sh, as build.yml does, and packs its libs directory.
# Usage: scripts/ci/desktop-linux/build-core.sh <output .tar.gz>
set -euo pipefail
mkdir -p "$(dirname "$1")"
out="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
arch=$(uname -m)
ghc_ver=$(ghc --numeric-version)
version=$(sed -n 's/^version: *//p' simplex-chat.cabal)
libs_dir=apps/multiplatform/common/src/commonMain/cpp/desktop/libs/linux-$arch
ghc --version
cabal --version
du -sh ~/.local/state/cabal/store ~/.cabal/store dist-newstyle 2> /dev/null || true
cat > cabal.project.local << EOF
ignore-project: False
jobs: \$ncpus
package direct-sqlcipher
flags: +openssl
EOF
# a restored dist-newstyle can hold an older version's build directory, which breaks the script's simplex-chat-* glob
find "dist-newstyle/build/$arch-linux/ghc-$ghc_ver" -maxdepth 1 -name 'simplex-chat-*' ! -name "simplex-chat-$version" -exec rm -rf {} + 2> /dev/null || true
SKIP_VLC=1 scripts/desktop/build-lib-linux.sh
ls -la "$libs_dir"
readelf -d "$libs_dir/libsimplex.so" | grep -E 'SONAME|RUNPATH|NEEDED'
echo "Selected symbols defined in libsimplex.so:"
nm -D --defined-only "$libs_dir/libsimplex.so" | awk '$NF ~ /^(chat_migrate_init_key|chat_send_cmd_retry|chat_recv_msg_wait)$/ {print " " $NF}'
du -sh "$libs_dir"
tar -C "$libs_dir" -czf "$out" .
ls -la "$out"