Skip to content

Commit 031cbc2

Browse files
MagicalTuxclaude
andcommitted
Replace tray-icon with ldtray; make gui default; drop the -server build
ldtray loads every platform toolkit at runtime (libdbus/shell32/AppKit via libloading) with zero compile-time GUI linkage, so one binary runs on both desktops and headless servers — on a server Tray::new just returns an error we ignore and run the worker without a tray. This removes the whole reason the separate `-server` build existed. - gui.rs rewritten against ldtray: worker on a background thread, a 1s refresher thread rebuilds the menu (via TrayHandle::set_menu) to track status, clicks handled in Tray::run on the main thread. ldtray also provides desktop notifications, so notify-rust is gone too. Menu, GPU list, pause/resume, and update-check feedback are unchanged in behavior. - gui is now a default feature; the only shipped build carries the tray. --no-default-features still yields a pure worker binary. - Deps: drop tray-icon, gtk, glib, windows-sys, notify-rust; add ldtray. CI drops the GTK/libxdo/appindicator apt install (nothing linked at build time) and the build-server job; build is now plain --release. - Auto-updater un-gated from the gui feature (the gating was a -server artifact): a single update stream for the single build. Both feature configs build/clippy/test/doc clean; ldtray tray verified live on Linux (worker claims + runs). Bump to 0.1.17. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 77c9f3b commit 031cbc2

5 files changed

Lines changed: 228 additions & 1861 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@ jobs:
3939

4040
- uses: Swatinem/rust-cache@v2
4141

42-
# The `gui` feature builds the system-tray UI. On Linux that needs GTK 3,
43-
# libxdo (cursor/X11 helper used by tray-icon) and an AppIndicator dev
44-
# package; Windows links these from the OS, so no extra packages there.
45-
- name: Install GUI build deps (Linux)
46-
if: runner.os == 'Linux'
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y --no-install-recommends \
50-
libgtk-3-dev libxdo-dev libayatana-appindicator3-dev
42+
# No GUI system packages needed: the `gui` feature uses ldtray, which loads
43+
# every platform toolkit at runtime — nothing is linked at build time.
5144

5245
# Provides the link-time CUDA driver library: the libcuda.so stub on Linux and
5346
# cuda.lib on Windows. The runtime libcuda is the NVIDIA driver on the volunteer
@@ -60,8 +53,9 @@ jobs:
6053
cuda: "12.6.0"
6154

6255
- name: Build
63-
# Release binaries ship the system-tray GUI by default.
64-
run: cargo build --release --locked --features gui
56+
# The `gui` feature (ldtray tray) is on by default; the one binary runs on
57+
# both desktops and headless servers.
58+
run: cargo build --release --locked
6559

6660
- name: Package (Linux → tar.gz)
6761
if: runner.os == 'Linux'
@@ -90,41 +84,3 @@ jobs:
9084
name: ${{ matrix.target }}
9185
path: target/release/${{ matrix.bin }}
9286
if-no-files-found: error
93-
94-
# Headless console build for servers: no GUI/tray, and — by design — no
95-
# auto-updater (the `master` update channel carries the GTK-linked GUI binary,
96-
# which won't start on a headless box). Shipped as a download-only release asset;
97-
# operators upgrade by re-downloading. Only the .tar.gz is uploaded (no
98-
# triple-named raw binary), so `rsupd publish --ci` never stages it into the
99-
# signed update package.
100-
build-server:
101-
name: linux-x86_64-server
102-
runs-on: ubuntu-latest
103-
steps:
104-
- uses: actions/checkout@v4
105-
106-
- uses: dtolnay/rust-toolchain@stable
107-
108-
- uses: Swatinem/rust-cache@v2
109-
110-
# build.rs links libcuda regardless of the GUI feature, so the CUDA toolkit
111-
# is still needed to resolve the driver symbols at link time.
112-
- name: Install CUDA toolkit
113-
uses: Jimver/cuda-toolkit@v0.2.35
114-
id: cuda
115-
with:
116-
cuda: "12.6.0"
117-
118-
- name: Build (console, no GUI)
119-
run: cargo build --release --locked
120-
121-
- name: Package (→ tar.gz)
122-
run: |
123-
mkdir -p dist
124-
tar -czf "dist/decryptd-linux-x86_64-server.tar.gz" -C target/release decryptd
125-
126-
- uses: actions/upload-artifact@v4
127-
with:
128-
name: decryptd-linux-x86_64-server.tar.gz
129-
path: dist/decryptd-linux-x86_64-server.tar.gz
130-
if-no-files-found: error

0 commit comments

Comments
 (0)