From 6fc6c1fd2c6110e47f7eaa592779c6548915d7b5 Mon Sep 17 00:00:00 2001 From: Xiaoyu Guan Date: Sat, 10 Oct 2026 17:58:44 +0800 Subject: [PATCH 1/2] ci: build and link the Fcitx5 plugin with portable outputs --- .github/workflows/ci.yml | 17 +++++++++++++++++ Linux/fcitx5/README.md | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e2a9ba..112e6fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,10 @@ jobs: # Same CMake/Ninja releases as the Mac runner (Core/Portable/README.md). - name: Install CMake and Ninja run: pipx install cmake==3.31.6 && pipx install ninja==1.11.1.4 + - name: Install Fcitx5 development dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends libfcitx5core-dev extra-cmake-modules - name: Cache the native runtime build uses: actions/cache@v5 with: @@ -49,6 +53,19 @@ jobs: # rustup picks the pinned toolchain from rust-toolchain.toml. - name: Build the native runtime and run cargo test run: bash Core/Portable/test.sh + # test.sh -> abi.sh already builds the debug staticlib and pinned librime. + # Reuse those outputs; this gate does not need another Cargo/native build. + - name: Configure the Fcitx5 plugin + run: | + cmake -S Linux/fcitx5 -B build/fcitx5 -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DINKFLOW_CARGO_DIR="$PWD/build/portable/cargo/debug" \ + -DINKFLOW_NATIVE_PREFIX="$PWD/build/portable/prefix" \ + -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--no-undefined" + - name: Compile and link the Fcitx5 plugin + run: cmake --build build/fcitx5 --parallel 4 --verbose + - name: Run Fcitx5 CTest + run: ctest --test-dir build/fcitx5 --output-on-failure --no-tests=error dictionary: name: Portable dictionary (cargo test) diff --git a/Linux/fcitx5/README.md b/Linux/fcitx5/README.md index 1e67ece..477364f 100644 --- a/Linux/fcitx5/README.md +++ b/Linux/fcitx5/README.md @@ -31,6 +31,12 @@ The addon links the crate's `staticlib` (which bundles the C++ bridge) and the p `bash Linux/fcitx5/test.sh` runs the helper tests anywhere; with `FCITX5_SOURCE=` it also compiles the addon syntax-only against those headers (export headers stubbed), which is how it was checked from macOS against fcitx5 5.1.14. +## Continuous integration + +The Linux `portable` job in [CI](../../.github/workflows/ci.yml) installs Ubuntu 24.04's Fcitx5 development packages and runs the actual CMake configure, build and link, followed by CTest. It reuses `Core/Portable/test.sh`'s debug Rust static library (`abi.sh` builds it) and pinned `librime.so` in the same job, without a second Rust or Rime build. The C++ addon uses `Release`; CI enables `--no-undefined` for the module link so unresolved addon/ABI symbols fail the build. Packaging keeps its release Rust profile. + +This gate covers compilation of `engine.cpp` and `candidates.cpp` against the distribution's Fcitx5 headers, linkage of `libinkflow.so` to Fcitx5 and the shared core, and the existing `bridge_test` behavior checks through CTest (assertions stay enabled in Release). The separate script/helper and isolated installer tests remain in CI. CTest currently exercises only the pure bridge helpers; it does not load the addon or run a desktop session. Installed-addon behavior, real application input, focus, personal-data migration, upgrade and rollback still need the isolated installed-addon tests and target-device validation below. Steam Deck/KDE Plasma validation remains deferred. + ## User-local installation and installed-addon test Use `Linux/scripts/package.sh` to build a package directory with the addon, target-native resources, notices, corresponding dictionary sources, and a SHA-256 file manifest. See [Linux installation](../README.md) for packaging and install commands. From fbc682fdca13344eddfce8fe1d8afae1f478981d Mon Sep 17 00:00:00 2001 From: Xiaoyu Guan Date: Sat, 10 Oct 2026 18:02:44 +0800 Subject: [PATCH 2/2] ci: use Ubuntu 26.04 for the required Fcitx5 API --- .github/workflows/ci.yml | 7 ++++--- Linux/fcitx5/README.md | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 112e6fe..7b3d86d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,8 @@ jobs: portable: name: Portable runtime (cargo test) - runs-on: ubuntu-24.04 + # Ubuntu 24.04's Fcitx5 5.1.7 lacks CandidateWord::setComment. + runs-on: ubuntu-26.04 timeout-minutes: 45 steps: - uses: actions/checkout@v5 @@ -48,8 +49,8 @@ jobs: uses: actions/cache@v5 with: path: build/portable - key: portable-${{ runner.os }}-${{ hashFiles('Core/Portable/native-sources.lock.json', 'Core/Portable/build-native.py', 'Core/Portable/native/**', 'Core/Portable/Cargo.lock', 'rust-toolchain.toml') }} - restore-keys: portable-${{ runner.os }}- + key: portable-${{ runner.os }}-ubuntu-26.04-${{ hashFiles('Core/Portable/native-sources.lock.json', 'Core/Portable/build-native.py', 'Core/Portable/native/**', 'Core/Portable/Cargo.lock', 'rust-toolchain.toml') }} + restore-keys: portable-${{ runner.os }}-ubuntu-26.04- # rustup picks the pinned toolchain from rust-toolchain.toml. - name: Build the native runtime and run cargo test run: bash Core/Portable/test.sh diff --git a/Linux/fcitx5/README.md b/Linux/fcitx5/README.md index 477364f..fad7f5b 100644 --- a/Linux/fcitx5/README.md +++ b/Linux/fcitx5/README.md @@ -16,7 +16,7 @@ Resources are found at `INKFLOW_RESOURCES` (a prepared directory from `Core/Port ## Build on Linux -Requirements: the repository's Rust toolchain, CMake 3.31.6 and Ninja 1.11.1.4 for the pinned native build, a C++20 compiler, Python 3, and the Fcitx5 development files (`fcitx5` on Arch/SteamOS, `libfcitx5core-dev` plus `extra-cmake-modules` on Ubuntu). Resource preparation uses `sha256sum` when available, otherwise `shasum -a 256`. From the checkout root: +Requirements: the repository's Rust toolchain, CMake 3.31.6 and Ninja 1.11.1.4 for the pinned native build, a C++20 compiler, Python 3, and the Fcitx5 development files (`fcitx5` on Arch/SteamOS, `libfcitx5core-dev` plus `extra-cmake-modules` on Ubuntu 26.04). Resource preparation uses `sha256sum` when available, otherwise `shasum -a 256`. From the checkout root: ```sh python3 Core/Portable/build-native.py @@ -33,7 +33,7 @@ The addon links the crate's `staticlib` (which bundles the C++ bridge) and the p ## Continuous integration -The Linux `portable` job in [CI](../../.github/workflows/ci.yml) installs Ubuntu 24.04's Fcitx5 development packages and runs the actual CMake configure, build and link, followed by CTest. It reuses `Core/Portable/test.sh`'s debug Rust static library (`abi.sh` builds it) and pinned `librime.so` in the same job, without a second Rust or Rime build. The C++ addon uses `Release`; CI enables `--no-undefined` for the module link so unresolved addon/ABI symbols fail the build. Packaging keeps its release Rust profile. +The Linux `portable` job in [CI](../../.github/workflows/ci.yml) installs Ubuntu 26.04's Fcitx5 5.1.19 development packages and runs the actual CMake configure, build and link, followed by CTest. It reuses `Core/Portable/test.sh`'s debug Rust static library (`abi.sh` builds it) and pinned `librime.so` in the same job, without a second Rust or Rime build. The C++ addon uses `Release`; CI enables `--no-undefined` for the module link so unresolved addon/ABI symbols fail the build. Packaging keeps its release Rust profile. Ubuntu 24.04's Fcitx5 5.1.7 lacks the `CandidateWord::setComment` API used by the addon; the portable cache is scoped to Ubuntu 26.04 to avoid reusing native outputs from a different distribution toolchain. This gate covers compilation of `engine.cpp` and `candidates.cpp` against the distribution's Fcitx5 headers, linkage of `libinkflow.so` to Fcitx5 and the shared core, and the existing `bridge_test` behavior checks through CTest (assertions stay enabled in Release). The separate script/helper and isolated installer tests remain in CI. CTest currently exercises only the pure bridge helpers; it does not load the addon or run a desktop session. Installed-addon behavior, real application input, focus, personal-data migration, upgrade and rollback still need the isolated installed-addon tests and target-device validation below. Steam Deck/KDE Plasma validation remains deferred.