Add Linux Flatpak packaging (retains CPU + GPU mining)#3270
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Flatpak packaging for Tari Universe, including the Flatpak manifest, desktop entry, AppStream metadata, helper scripts, and several patches to accommodate the sandboxed environment. Feedback on the changes highlights a redundant and incorrect DBus permission in the Flatpak manifest, and suggests using std::env::var_os instead of std::env::var for XDG_RUNTIME_DIR in the system tray manager to robustly handle non-UTF-8 paths.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| # Autostart-on-login is requested through the Background portal | ||
| - --talk-name=org.freedesktop.portal.Background |
There was a problem hiding this comment.
The --talk-name=org.freedesktop.portal.Background permission is redundant and uses an incorrect DBus bus name. Portals are hosted under the org.freedesktop.portal.Desktop bus name, and Flatpak automatically grants sandboxed applications access to the portal service by default. Therefore, no explicit --talk-name permission is required to use the Background portal.
# Autostart-on-login is requested through the Background portal (no explicit permission needed)There was a problem hiding this comment.
Good catch — removed the org.freedesktop.portal.Background talk-name; portals are auto-granted and that was a vestigial line. Fixed in the latest push.
| if let (Some(flatpak_id), Ok(runtime_dir)) = | ||
| (std::env::var_os("FLATPAK_ID"), std::env::var("XDG_RUNTIME_DIR")) | ||
| { |
There was a problem hiding this comment.
Using std::env::var for XDG_RUNTIME_DIR can fail if the environment variable contains non-UTF-8 characters. Since XDG_RUNTIME_DIR represents a filesystem path, it is more robust to use std::env::var_os which returns an OsString. This avoids potential UTF-8 decoding errors and integrates seamlessly with std::path::Path APIs.
| if let (Some(flatpak_id), Ok(runtime_dir)) = | |
| (std::env::var_os("FLATPAK_ID"), std::env::var("XDG_RUNTIME_DIR")) | |
| { | |
| if let (Some(flatpak_id), Some(runtime_dir)) = | |
| (std::env::var_os("FLATPAK_ID"), std::env::var_os("XDG_RUNTIME_DIR")) | |
| { |
There was a problem hiding this comment.
Done — switched XDG_RUNTIME_DIR (and FLATPAK_ID) to env::var_os so it stays in OsString/Path land. Pushed.
Rust 1.96 rejects a crate-private type leaking through a public trait method as a hard error (E0446). PoolStatus is pub(crate) but appears in PoolManagerInterfaceTrait::construct_callback_for_pool_status_update. Widen it to pub — a no-op for this binary crate, valid on both 1.95 and 1.96.
tray-icon writes the icon to $XDG_RUNTIME_DIR/tray-icon, which Flatpak remaps to a per-app backing dir the StatusNotifier host cannot read, so the icon renders blank (the menu still works). Under FLATPAK_ID, point the tray temp dir at $XDG_RUNTIME_DIR/app/$FLATPAK_ID/tray-icon (shared at an identical path inside and outside the sandbox) and set the colour app icon. Inert outside Flatpak.
Fully offline flatpak-builder manifest (GNOME 50 runtime) with the Ayatana AppIndicator and protoc build modules, packaging patches, generated cargo/npm offline sources, desktop + AppStream metadata, and a standalone GitHub Actions workflow that builds the bundle and attaches it to releases. Retains CPU and GPU mining. See flatpak/README.md.
93eb9b1 to
505b361
Compare
What
Adds a Flatpak package for Linux (
com.tari.universe) plus a standalone CIworkflow that builds it and attaches the bundle to releases. CPU and GPU
mining are retained — the existing sidecars (xmrig, lolMiner, minotari node/
wallet, mmproxy, sha-p2pool, tor) download and run inside the sandbox as today.
Why
Linux mining was never removed from the app, only the
.deb/.AppImagepackaging (per the note in
release.yml: too many distro variations). Asingle Flatpak runtime is the targeted fix for that fragmentation.
Contents
flatpak/— fully offlineflatpak-buildermanifest (GNOME 50 runtime),the Ayatana AppIndicator + protoc build modules, four packaging patches,
generated cargo/npm offline sources, desktop + AppStream metadata, docs.
.github/workflows/flatpak.yml— standalone, additive; regenerates theoffline sources from each release's lockfiles so it needs no per-release
upkeep. Does not touch
release.yml.PoolStatuswidened topub— Rust 1.96 rejects thepub(crate)leak (E0446).$XDG_RUNTIME_DIR/app/$FLATPAK_IDpath;FLATPAK_ID-gated, inert elsewhere.Testing
Built and run on KDE Plasma (Wayland) / Alpine: launches, theme follows the DE,
tray renders, local mainnet node + CPU mining (xmrig) verified. Produces a
sideload
.flatpak(no auto-update — the bundled updater is disabled underFlatpak by design).
Notes
— would appreciate a tester.