Skip to content

Add Linux Flatpak packaging (retains CPU + GPU mining)#3270

Open
nattatt wants to merge 3 commits into
tari-project:mainfrom
nattatt:linux/flatpak-packaging
Open

Add Linux Flatpak packaging (retains CPU + GPU mining)#3270
nattatt wants to merge 3 commits into
tari-project:mainfrom
nattatt:linux/flatpak-packaging

Conversation

@nattatt

@nattatt nattatt commented Jun 7, 2026

Copy link
Copy Markdown

What

Adds a Flatpak package for Linux (com.tari.universe) plus a standalone CI
workflow 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/.AppImage
packaging (per the note in release.yml: too many distro variations). A
single Flatpak runtime is the targeted fix for that fragmentation.

Contents

  • flatpak/ — fully offline flatpak-builder manifest (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 the
    offline sources from each release's lockfiles so it needs no per-release
    upkeep. Does not touch release.yml.
  • Two source fixes (independent of packaging, useful on their own):
    • PoolStatus widened to pub — Rust 1.96 rejects the pub(crate) leak (E0446).
    • Tray icon renders under Flatpak — written to the host-shared
      $XDG_RUNTIME_DIR/app/$FLATPAK_ID path; 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 under
Flatpak by design).

Notes

  • GPU: NVIDIA path is wired via the auto GL extension; AMD OpenCL is untested
    — would appreciate a tester.
  • x86_64 only for now (arm64 = a second matrix leg).
  • Happy to split the two source fixes into separate PRs if preferred.

@nattatt nattatt requested a review from a team as a code owner June 7, 2026 04:38

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread flatpak/com.tari.universe.yml Outdated
Comment on lines +39 to +40
# Autostart-on-login is requested through the Background portal
- --talk-name=org.freedesktop.portal.Background

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src-tauri/src/systemtray_manager.rs Outdated
Comment on lines +473 to +475
if let (Some(flatpak_id), Ok(runtime_dir)) =
(std::env::var_os("FLATPAK_ID"), std::env::var("XDG_RUNTIME_DIR"))
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"))
{

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — switched XDG_RUNTIME_DIR (and FLATPAK_ID) to env::var_os so it stays in OsString/Path land. Pushed.

nattatt added 3 commits June 7, 2026 00:49
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.
@nattatt nattatt force-pushed the linux/flatpak-packaging branch from 93eb9b1 to 505b361 Compare June 7, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant