fix(build): make AppImages installable via Gear Lever, fix bundling on Arch - #304
fix(build): make AppImages installable via Gear Lever, fix bundling on Arch#304YahyaZekry wants to merge 4 commits into
Conversation
|
Thanks for this — genuinely good work. I verified each claim against upstream rather than taking the description at face value, and they all hold up: Two things I'd like fixed in this PR, then a few follow-ups. 1. License attribution on the vendored script ( 2. 3. Docs ( Follow-ups, no need to block on these:
On timing: I'm cutting a release right now that carries a large new feature, and this PR changes the bundler for every platform (2.10.0 → 2.11.4) with nothing in CI validating bundle output. I don't want to move both at once, so I'd rather land this immediately after that release goes out, with the two items above fixed. Nothing about the change itself is blocking it. Nice bit of debugging on the |
…n Arch - bump @tauri-apps/cli to ^2.11.4: tauri-bundler <=2.10 created absolute .desktop/.DirIcon symlinks in the AppDir; Gear Lever extracts with 7z, which turns absolute symlinks into dangling ones, finds no desktop entry and crashes on install (upstream fix: tauri#15596) - add src-tauri/desktop.template (Categories=Network;FileTransfer;) and wire it for deb/rpm so the AppImage desktop entry is no longer missing Categories (AppImage bundling reuses the deb data generator) - set NO_STRIP=1 when running linuxdeploy: its bundled strip predates .relr.dyn relocations and any strip failure aborts bundling on modern toolchains; also set it in release.yml for CI - vendor a patched linuxdeploy-plugin-gtk.sh: skip copy_tree sources that don't exist and mkdir -p before writing loaders.cache — Arch's gdk-pixbuf pkg-config paths are stale (loaders built in), which made the GTK plugin exit 1 under set -e. Synced into ~/.cache/tauri/ by the new pnpm tauri:appimage script
…g key `createUpdaterArtifacts` is true in the committed config, so `pnpm tauri:appimage` bundled the AppImage and then exited 1 signing it — the release signing key isn't available outside CI. Disable updater artifacts for the local AppImage script only; CI is unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A4caqH8dy3gKLKSoJgpv2W
Review feedback on tonhowtf#304. The vendored linuxdeploy-plugin-gtk.sh carried no provenance, so nobody could tell what was ours or rebase it onto a newer upstream. It now names the source repo, the commit it was copied at, the MIT notice, and the three local hunks. Copying it into ~/.cache/tauri also pinned our patched copy for every Tauri project on the machine, forever, because the bundler only downloads the plugin when the file is missing. Turning on bundle.useLocalToolsDir moves the tool cache into src-tauri/target/.tauri instead, so the build touches nothing outside the repo and `cargo clean` undoes it. The command grew past what belongs in a package.json string, so it lives in scripts/linux/appimage.sh now and says which plugin it installed. README documents `pnpm tauri:appimage` next to the existing from-source build flag rather than in a second place that would drift from it. Also gates NO_STRIP on ubuntu, matching LDAI_UPDATE_INFORMATION right above it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`bundle` already had a "linux" key for the deb `libasound2` depends, and this branch added a second one. JSON keeps the last of a duplicate key, so `desktopTemplate` was dropped on the floor: the AppImage shipped the stock Tauri entry with an empty `Categories=`. Merging the two blocks makes the template take effect. Verified by building the AppImage and reading the entry out of the AppDir. While in there, the template now matches flatpak/wtf.tonho.omniget.desktop -- same Categories, plus the GenericName and Keywords that make the app findable in a menu search -- and says why those three lines are hardcoded instead of coming from `bundle.category`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4934b7a to
47d5cb3
Compare
tonhowtf
left a comment
There was a problem hiding this comment.
Verified end to end: the Gear Lever crash is the absolute omniget.desktop symlink that tauri-bundler ≤ 2.10 wrote (7z mangles it, _get_app_version gets None), and tauri-cli 2.11.4 fixes it in linuxdeploy.rs by symlinking relatively — so the @tauri-apps/cli bump is the whole Gear Lever fix and no AppStream metadata is needed. The vendored linuxdeploy-plugin-gtk.sh diffs against upstream b5eb8d05 (exactly what the bundler downloads) in only the three documented hunks, and each one matches a real Arch failure (.relr.dyn vs bundled binutils, stale gdk_pixbuf_binarydir, unconditional sed -i on a missing loaders.cache). useLocalToolsDir is honoured by the bundler, the duplicate linux key is gone, the desktop template matches the 2.11.4 default plus the Flatpak categories, merge-tree against main is clean, and all 8 checks pass.
One optional nit: the NO_STRIP env in release.yml does nothing on the release runners today (v0.9.0 shipped both AppImages without it, and [profile.release] strip = true already strips the binary); scripts/linux/appimage.sh already sets it for the local Arch case. It's harmless, so keep it if you want it as future-proofing — I just wouldn't call it part of the fix.
Since 0.9.0 is already out, this is safe to land now; the bundler bump only gets exercised at the next tag.
Fix(build): Make AppImages installable via Gear Lever, fix bundling on Arch
Problem
AppImages built from this repo fail to install in Gear Lever (and possibly other AppImage managers), and
tauri build --bundles appimageno longer completes on Arch-based systems at all.1. Absolute
.desktop/.DirIconsymlinks → Gear Lever crashtauri-bundler≤ 2.10 created absolute symlinks in the AppDir:Gear Lever extracts bundles with
7z, which rewrites absolute symlinks as paths inside its temp extraction folder — they become dangling, no desktop entry is found, and install crashes:Fixed upstream in tauri-apps/tauri#15596 — this PR bumps
@tauri-apps/clito^2.11.4so both symlinks are relative again.2. linuxdeploy
stripfails on modern ELF → bundling abortslinuxdeploy's bundled
strippredates.relr.dyn(DT_RELR) relocations used by current glibc/webkit2gtk packages. Every strip call fails (unknown type [0x13] section '.relr.dyn'), and since any strip failure setssuccess = false, bundling aborts. Refreshing cached linuxdeploy doesn't help — upstream still ships old binutils.Fix: set
NO_STRIP=1(honored by linuxdeploy) inrelease.yml, gated on the ubuntu runners to matchLDAI_UPDATE_INFORMATIONdirectly above it.3. GTK plugin fails on Arch → bundling aborts
Tauri's vendored
linuxdeploy-plugin-gtk.shruns underset -eand assumes/usr/lib/gdk-pixbuf-2.0/2.10.0exists (per pkg-config). Arch ships gdk-pixbuf with loaders built in but keeps the stale pkg-config path, socopy_treefails, then theloaders.cachewrite fails:Fix: vendor a patched copy at
scripts/linux/linuxdeploy-plugin-gtk.shwith three changes:copy_treeskips sources that don't exist (with a warning) instead of aborting.mkdir -pbefore writingloaders.cache.sed -ionloaders.cachemoved inside the-fguard. Upstream ran it unconditionally, so a missing cache trippedset -eimmediately after warning that it was only a warning.The file carries a header naming the source repo, the commit it was copied at (
b5eb8d05, the exact URL Tauri fetches), the MIT notice, the three local hunks, and how to re-sync. It is otherwise byte-identical to upstream.4. Missing updater signing key → build exits 1
createUpdaterArtifactsistruein the committed config, so after successfully bundling the AppImage the build tried to sign it and aborted:The release key isn't available outside CI, so building an AppImage from source always ended in a non-zero exit.
How the local build is wired
pnpm tauri:appimagerunsscripts/linux/appimage.sh, which setsNO_STRIP=1, turns offcreateUpdaterArtifacts, and hands the bundler the patched plugin.The plugin goes into the project's
src-tauri/target/.tauri/, not the shared~/.cache/tauri/. This matters: the bundler only downloads a plugin when the file is missing and never checksums it, so dropping our patched copy in the user cache would pin it for every Tauri project on that machine, permanently, including after a Tauri release fixes this upstream. Settingbundle.useLocalToolsDirmoves the whole tool cache into the cargo target directory, so the build touches nothing outside the repo andcargo cleanundoes it. The script echoes where it installed the plugin.README.mddocumentspnpm tauri:appimagein the same section as the existingcreateUpdaterArtifactsescape hatch from #298, rather than in a second place that would drift.Desktop entry
src-tauri/desktop.templateis wired viabundle.linux.deb/rpm.desktopTemplate; the AppImage bundler reuses the deb data generator, so deb/rpm/AppImage stay consistent.The generated entry previously had an empty
Categories=. It now matchesflatpak/wtf.tonho.omniget.desktop—Categories=Network;FileTransfer;Utility;plusGenericNameandKeywords, which improve app-menu search. Those three lines are hardcoded rather than derived frombundle.category, becausesettings.app_category()maps through a fixedAppCategorytable that can't express a multi-value list; the template says so, so nobody "fixes" it later.Verification
On Arch (glibc 2.42, webkit2gtk 4.1), building the AppImage end to end:
pnpm tauri:appimagecompletes with exit code 0 ✅ (previously failed on strip, then the gtk plugin, then the missing signing key)application/x-desktop✅MimeType=x-scheme-handler/omniget;desktop-file-validatepasses ✅src-tauri/target/.tauri/; the build writes nothing to~/.cache/tauri/✅Two notes on the verification, since an earlier revision of this PR got one of them wrong:
bundlealready had a"linux"key for the deblibasound2depends, and this branch added a second one. JSON keeps the last of a duplicate key, sodesktopTemplatewas dropped on the floor and the AppImage kept shipping the stock Tauri entry with an emptyCategories=. Merging the two blocks fixes it, and the categories above were then read back out of the built AppDir rather than assumed.--no-default-features. Thelinux-capturefeature's pipewire bindgen needs libclang, which isn't installed on this machine. That's unrelated to this PR, but it means the default-feature build path isn't covered by the run above.Local-only files (
scripts/linux/, template) are safe for CI: tauri-action downloads its own plugin copy, and Ubuntu runners have real gdk-pixbuf loader dirs.