From 3752419075952bc0c56446f77aa576b7867d151f Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Fri, 2 Oct 2026 16:38:58 +0100 Subject: [PATCH] CI: build the Linux tray natively with GTK; drop the aarch64 GUI The aarch64 GUI cross-build failed: tray-icon links GTK and libappindicator through pkg-config, which zig cross-compilation cannot satisfy without a target sysroot. Rather than set one up, the Linux tray is now built natively on the x86_64 runner with libgtk-3-dev and libayatana-appindicator3-dev installed, so pkg-config just works. The agent is still static musl for both arches. The aarch64 Linux GUI is dropped for now: that archive stays agent-only and no aarch64 tsunagi-gui package is produced. x86_64 gets the tray in its archive and the tsunagi-gui .deb/.pkg.tar.zst. macOS and Windows build the tray natively as before. Guarded on matrix.gnu_target (set only on x86_64 Linux). Note: the native build links the runner's glibc, so the Linux GUI binary needs a reasonably recent glibc; fine for current desktops. A lower baseline would need a GTK sysroot or an older runner image. YAML validated; the Linux GUI build is exercised only by a real CI run. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/release.yml | 25 +++++++++++++++++-------- .github/workflows/release.yml | 25 +++++++++++++++++-------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index fad726a..eb3ba69 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -45,7 +45,6 @@ jobs: deb: true deb_arch: arm64 pkg_arch: aarch64 - gnu_target: aarch64-unknown-linux-gnu - os: macos-latest target: aarch64-apple-darwin asset: tsunagi-macos-aarch64 @@ -111,11 +110,19 @@ jobs: shell: bash run: | set -euo pipefail - export RUSTFLAGS="${RUSTFLAGS:-} -A linker_messages" if [[ "${{ runner.os }}" == "Linux" ]]; then - rustup target add "${{ matrix.gnu_target }}" - cargo zigbuild --release --locked \ - --target "${{ matrix.gnu_target }}.2.28" --bin tsunagi-tray + if [[ -n "${{ matrix.gnu_target }}" ]]; then + # tray-icon links GTK and libappindicator through pkg-config, which + # has no cross story under zig, so the Linux GUI is built natively + # (x86_64 only) against the runner's glibc. + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libgtk-3-dev libayatana-appindicator3-dev + cargo build --release --locked \ + --target "${{ matrix.gnu_target }}" --bin tsunagi-tray + else + echo "no GUI build for ${{ matrix.target }}" + fi else cargo build --release --locked --target "${{ matrix.target }}" --bin tsunagi-tray fi @@ -133,11 +140,13 @@ jobs: [[ "${{ runner.os }}" == "Windows" ]] && bin="tsunagi.exe" cp "target/${{ matrix.target }}/release/${bin}" "$stage/" - # The tray GUI alongside it: glibc build on Linux, native elsewhere. + # The tray GUI alongside it, where it was built (Linux: x86_64 only). tray="tsunagi-tray" [[ "${{ runner.os }}" == "Windows" ]] && tray="tsunagi-tray.exe" if [[ "${{ runner.os }}" == "Linux" ]]; then - cp "target/${{ matrix.gnu_target }}/release/${tray}" "$stage/" + if [[ -n "${{ matrix.gnu_target }}" ]]; then + cp "target/${{ matrix.gnu_target }}/release/${tray}" "$stage/" + fi else cp "target/${{ matrix.target }}/release/${tray}" "$stage/" fi @@ -201,7 +210,7 @@ jobs: # The GUI variants: the same agent plus the tray binary and a desktop # launcher, named tsunagi-gui (conflicting with the headless packages). - name: Build the GUI packages - if: matrix.deb + if: matrix.gnu_target shell: bash run: | set -euo pipefail diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 188c7ba..bf759ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,6 @@ jobs: deb: true deb_arch: arm64 pkg_arch: aarch64 - gnu_target: aarch64-unknown-linux-gnu - os: macos-latest target: aarch64-apple-darwin asset: tsunagi-macos-aarch64 @@ -113,11 +112,19 @@ jobs: shell: bash run: | set -euo pipefail - export RUSTFLAGS="${RUSTFLAGS:-} -A linker_messages" if [[ "${{ runner.os }}" == "Linux" ]]; then - rustup target add "${{ matrix.gnu_target }}" - cargo zigbuild --release --locked \ - --target "${{ matrix.gnu_target }}.2.28" --bin tsunagi-tray + if [[ -n "${{ matrix.gnu_target }}" ]]; then + # tray-icon links GTK and libappindicator through pkg-config, which + # has no cross story under zig, so the Linux GUI is built natively + # (x86_64 only) against the runner's glibc. + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libgtk-3-dev libayatana-appindicator3-dev + cargo build --release --locked \ + --target "${{ matrix.gnu_target }}" --bin tsunagi-tray + else + echo "no GUI build for ${{ matrix.target }}" + fi else cargo build --release --locked --target "${{ matrix.target }}" --bin tsunagi-tray fi @@ -135,11 +142,13 @@ jobs: [[ "${{ runner.os }}" == "Windows" ]] && bin="tsunagi.exe" cp "target/${{ matrix.target }}/release/${bin}" "$stage/" - # The tray GUI alongside it: glibc build on Linux, native elsewhere. + # The tray GUI alongside it, where it was built (Linux: x86_64 only). tray="tsunagi-tray" [[ "${{ runner.os }}" == "Windows" ]] && tray="tsunagi-tray.exe" if [[ "${{ runner.os }}" == "Linux" ]]; then - cp "target/${{ matrix.gnu_target }}/release/${tray}" "$stage/" + if [[ -n "${{ matrix.gnu_target }}" ]]; then + cp "target/${{ matrix.gnu_target }}/release/${tray}" "$stage/" + fi else cp "target/${{ matrix.target }}/release/${tray}" "$stage/" fi @@ -203,7 +212,7 @@ jobs: # The GUI variants: the same agent plus the tray binary and a desktop # launcher, named tsunagi-gui (conflicting with the headless packages). - name: Build the GUI packages - if: matrix.deb + if: matrix.gnu_target shell: bash run: | set -euo pipefail