diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efca8434d8..42d7df6350 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,11 @@ jobs: name: Rust Build Check (${{ matrix.os }}) runs-on: ${{ matrix.os }} needs: frontend-build + env: + # Keep the workspace check plus desktop test profiles within hosted-runner disk limits. + CARGO_INCREMENTAL: "0" + CARGO_PROFILE_DEV_DEBUG: "0" + CARGO_PROFILE_TEST_DEBUG: "0" strategy: fail-fast: false matrix: @@ -123,7 +128,7 @@ jobs: - uses: swatinem/rust-cache@v2 with: - shared-key: "ci-check-v2-${{ runner.os }}-no-cargo-bin-v1" + shared-key: "ci-check-v3-${{ runner.os }}-no-cargo-bin-v1" cache-bin: false # PR caches are scoped to merge refs; main pushes own shared cache refreshes. save-if: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/desktop-package.yml b/.github/workflows/desktop-package.yml index f45f76430a..e2e8aab6b5 100644 --- a/.github/workflows/desktop-package.yml +++ b/.github/workflows/desktop-package.yml @@ -174,11 +174,14 @@ jobs: APPINDICATOR_PKG=libayatana-appindicator3-dev fi + # Tauri pins AppImage GTK input methods to its bundled cache, so the + # fcitx5 GTK3 bridge must be present before linuxdeploy builds it. sudo apt-get install -y --no-install-recommends \ pkg-config \ xdg-utils \ libglib2.0-dev \ libgtk-3-dev \ + fcitx5-frontend-gtk3 \ libxdo-dev \ "$WEBKIT_PKG" \ "$APPINDICATOR_PKG" \ @@ -220,6 +223,11 @@ jobs: - name: Build desktop app run: ${{ matrix.platform.build_command }} + - name: Verify AppImage fcitx5 GTK module + if: runner.os == 'Linux' + shell: bash + run: bash scripts/ci/verify-appimage-fcitx.sh "${{ matrix.platform.target }}" + - name: Upload bundles uses: actions/upload-artifact@v6 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b3c7fb3380..c350888f7d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -120,11 +120,14 @@ jobs: APPINDICATOR_PKG=libayatana-appindicator3-dev fi + # Tauri pins AppImage GTK input methods to its bundled cache, so the + # fcitx5 GTK3 bridge must be present before linuxdeploy builds it. sudo apt-get install -y --no-install-recommends \ pkg-config \ xdg-utils \ libglib2.0-dev \ libgtk-3-dev \ + fcitx5-frontend-gtk3 \ libxdo-dev \ "$WEBKIT_PKG" \ "$APPINDICATOR_PKG" \ @@ -192,6 +195,11 @@ jobs: - name: Build desktop app run: ${{ matrix.platform.build_command }} + - name: Verify AppImage fcitx5 GTK module + if: runner.os == 'Linux' + shell: bash + run: bash scripts/ci/verify-appimage-fcitx.sh "${{ matrix.platform.target }}" + - name: Upload bundles uses: actions/upload-artifact@v6 with: diff --git a/scripts/ci/verify-appimage-fcitx.sh b/scripts/ci/verify-appimage-fcitx.sh new file mode 100644 index 0000000000..d609dd27e7 --- /dev/null +++ b/scripts/ci/verify-appimage-fcitx.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -euo pipefail + +target="${1:?usage: verify-appimage-fcitx.sh }" +bundle_dir="target/${target}/release/bundle/appimage" + +mapfile -t appimages < <(find "$bundle_dir" -maxdepth 1 -type f -name '*.AppImage' -print | sort) +if [[ ${#appimages[@]} -ne 1 ]]; then + echo "Expected exactly one AppImage in ${bundle_dir}, found ${#appimages[@]}" >&2 + exit 1 +fi + +appimage="$(realpath "${appimages[0]}")" +work_dir="$(mktemp -d)" +trap 'rm -rf "$work_dir"' EXIT + +( + cd "$work_dir" + chmod +x "$appimage" + "$appimage" --appimage-extract >/dev/null + + module_path="$(find squashfs-root -name 'im-fcitx5.so' -print -quit)" + if [[ -z "$module_path" ]]; then + echo "AppImage does not contain the fcitx5 GTK3 input method module" >&2 + exit 1 + fi + + cache_path="" + while IFS= read -r candidate; do + if grep -qi 'fcitx' "$candidate"; then + cache_path="$candidate" + break + fi + done < <(find squashfs-root -name 'immodules.cache' -type f -print) + + if [[ -z "$cache_path" ]]; then + echo "AppImage GTK immodules.cache does not register fcitx5" >&2 + exit 1 + fi + + echo "Verified AppImage fcitx5 GTK module: module=${module_path}, cache=${cache_path}" +) diff --git a/src/apps/desktop/tauri.conf.json b/src/apps/desktop/tauri.conf.json index e7c18cc338..bc2d8949d5 100644 --- a/src/apps/desktop/tauri.conf.json +++ b/src/apps/desktop/tauri.conf.json @@ -24,8 +24,20 @@ "linux": { "deb": { "depends": [ - "libwebkit2gtk-4.1-0", - "libgtk-3-0" + "libc6", + "libcairo2", + "libgcc-s1", + "libgdk-pixbuf-2.0-0", + "libglib2.0-0", + "libjavascriptcoregtk-4.1-0", + "liblept5", + "liblzma5", + "libsoup-3.0-0", + "libtesseract5", + "libxcb1", + "libxdo3", + "tesseract-ocr-eng", + "zlib1g" ], "files": { "/usr/share/icons/hicolor/16x16/apps/bitfun-desktop.png": "icons/hicolor/16x16/apps/bitfun-desktop.png",