Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,40 @@ 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
# 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:
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
# 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)
Expand Down
8 changes: 7 additions & 1 deletion Linux/fcitx5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=<fcitx5 source tree>` 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 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.

## 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.
Expand Down
Loading