Skip to content

Unpacked AppImages: libraries and APPDIR for programs named inside them, and the guide on running unpacked - #486

Merged
elripalda merged 4 commits into
elripalda:mainfrom
Xarishark:feat/appimage-unpacked-a64bbf
Nov 24, 2026
Merged

elripalda merged 4 commits into
elripalda:mainfrom
Xarishark:feat/appimage-unpacked-a64bbf

Conversation

@Xarishark

@Xarishark Xarishark commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Every Linux build of the launcher plays AppImages from an unpacked folder (#310). This makes that sturdier, and tells developers why and what their AppImage has to do for it.

A program named inside an unpacked AppImage couldn't find the libraries it ships with

With Easy Setup on, MKW Recomp closed at once: mkw: error while loading shared libraries: libvpx.so.6 (code 127). Its catalog profile names mkw, which since #310 is found in the game's folder and started by itself. Its AppRun is what puts the AppImage's lib/ on LD_LIBRARY_PATH, and a profile can't set that variable. Before #310 the profile's program wasn't there and the AppImage started instead. 20 catalog AppImage games name a program inside the AppImage like this (MKW, Astral Chain, XCX, XC2, MetroFuse, KNID, UltraCombo and others).

  • appimage_libs: a program inside an unpacked AppImage (the nearest folder with an AppRun, within the game's folder) that isn't AppRun gets the AppImage's library folders first on LD_LIBRARY_PATH (lib, lib64, usr/lib, usr/lib64, usr/lib/<arch>-linux-gnu, those that exist), then the PC's own list (sysenv::for_games, the PC's value without the launcher's own AppImage folders).
  • appimage_vars: what the AppImage runtime sets for the program it starts now comes from one place, for Play and setup steps alike. APPDIR (the AppImage's folder), OWD (the folder it starts in), and for AppRun ARGV0. A program named inside the AppImage gets APPDIR and OWD too. Plain folders get nothing. APPIMAGE is still never set.
  • The unpacker's trail line for links it leaves out (absolute ones, or ones leading out of the AppImage) now names the first five and where they pointed, instead of only how many.

Developer tools

  • A warning for a program named inside an unpacked AppImage. When start.program or prepare.program names a program inside an unpacked AppImage that isn't its AppRun (MKW's mkw), developer tools show a yellow warning. It says what that program misses (everything its AppRun sets up besides the library folders, APPDIR and OWD) and that it's fine when the program runs on its own (an rpath like $ORIGIN/lib). It uses the same appimage_root as the start code, so the check and what Play does can't drift apart.
  • No more false error for profiles that name their AppImage. Developer tools read a release's own recomplauncher.json without the AppRun mapping Play applies (profile::to_apprun). So once the AppImage was unpacked, every profile naming its AppImage, as the guide asks, got a red "None of start.program is in this folder", while Play started it fine. The file is now read as Play reads it (read_profile). This was already on main.

The developer guide

  • Why a plain folder: mounting needs FUSE and can't happen in the Flatpak; a mount is read-only and moves on every start (so a game or setup step writing next to itself fails with "Read-only file system", as Hookshot's DLSS step did before On Linux every game plays from a plain folder, never an AppImage #310); and updates, saves and mods need a folder they can reach.
  • New: "Your AppImage has to run unpacked". It asks for the same as a tarball, with a way to try it (--appimage-extract, then AppRun with APPIMAGE unset), and covers:
    • finding files through APPDIR or /proc/self/exe
    • bringing libraries that an rpath ($ORIGIN/lib) or AppRun finds
    • not moving yourself out of your folder (MKW's AppRun copies mkw to ~/.local/share)
    • not bundling system libraries that an AppRun's LD_LIBRARY_PATH hands to cp and mkdir (Super Mario World's libpcre2 warnings)
    • keeping links inside the AppImage
  • The release rules and Recomp Standards point there. The AppRun bullets mention OWD and the links left out, and say to name a program inside the AppImage only when it runs on its own, which developer tools warn about.

For the website (SDK guide): explain why the launcher plays Linux AppImages unpacked (no FUSE, the Flatpak, read-only moving mounts, updates and saves need a folder). Add "Your AppImage has to run unpacked" with its test steps (--appimage-extract, then AppRun without APPIMAGE). Say that a start.program naming a program inside an AppImage gets APPDIR, OWD and the AppImage's library folders on LD_LIBRARY_PATH, but nothing else its AppRun sets, and that developer tools warn about it: name the AppImage unless the program runs on its own.

How you tested it

On bazzite-kde (Bazzite, KDE), a debug build of this branch, each game freshly installed from its real release (the AppImage unpacked into a plain folder), then started with --play (the start code the Play button uses). For each game the check read the running process's environment, its output and the trail.

  • Easy Setup skipped (its AppRun): Shipwright, Savage Wind, SpartanPort, Dusklight, Wind Waker HD, Melee, Super Mario World, Prime, LAS and MKW all start from their unpacked folders with APPDIR, OWD and ARGV0 set. There were no library, read-only or missing-file errors; Shipwright, Dusklight and Melee log their normal start.

  • Easy Setup on:

    • Wind Waker HD, Ridge Racer Type 4 (its profile's program isn't at the top, so it falls back to AppRun) and LAS start through AppRun.
    • UltraCombo's profile names its program directly. It starts with APPDIR, OWD and LD_LIBRARY_PATH=<game>/lib, and says it needs its game files. The released Beta 68 also starts it, so its program finds its libraries on its own.
    • Shipwright, Savage Wind, SpartanPort, Dusklight, Melee, Super Mario World and Prime ask for the player's own copy first, as they should. There were no game files to go further.
  • MKW with Easy Setup on: the Beta 67-era build stopped with the libvpx.so.6 error. This branch reached MKW's own start screen. AngeloAscheri confirmed the same on a second Bazzite PC with a real dump (comment on #467), with /proc/<pid>/maps showing libvpx, libSDL3 and libopus loaded from the game's lib/.

  • Developer tools on real installs: MKW (profile names mkw) shows "Play starts mkw" with the new warning. Savage Wind (profile names its AppImage) shows "Play starts AppRun --game" with no error; before, it showed the red "None of start.program is in this folder".

  • In distrobox: cargo test passes all 1019, including 13 new tests (4 for the library folders, 3 for appimage_vars, 2 for the link note, 4 for developer tools). node --test tests/*.test.cjs passes all 766.

  • npm test passes

  • node --test tests/*.test.cjs passes

  • Tried it in the launcher (bazzite-kde, debug build, real releases)

Not tried: a game whose profile names a program inside the AppImage and gets as far as playing with the player's own files, other than MKW on AngeloAscheri's PC.

Checklist

  • One change per pull request (running AppImages unpacked: the launcher side and the guide)
  • No version bump or patch notes (those are done at release time)
  • If it changes what developers can write in recomplauncher.json: the schema and docs are updated too (no new fields; the guide says how AppImages run)

With Easy Setup on, MKW Recomp closed at once with code 127 on Linux:
"mkw: error while loading shared libraries: libvpx.so.6". Its profile names
mkw, which since AppImages are unpacked (elripalda#310) is found in the game's folder
and started by itself. Its AppRun is what puts the AppImage's lib/ folder on
LD_LIBRARY_PATH, so without it the libraries mkw ships with weren't found.
Before elripalda#310 the profile's program wasn't there and the AppImage started instead.

A program inside an unpacked AppImage that isn't its AppRun now gets the
AppImage's own library folders first on LD_LIBRARY_PATH (lib, lib64, usr/lib,
usr/lib64 and usr/lib/<arch>-linux-gnu, those that exist), with the PC's own
list after them, for Play and for a setup step. A profile can't set that
variable itself. The developer guide says so beside the AppRun rules.

On bazzite-kde, a fresh MKW install with Easy Setup on stopped with the libvpx
error on the old build and reached the game's start screen on this one.
… out are named

What the AppImage runtime sets for the program it starts now comes from one
place (appimage_vars), the same for Play and a setup step: APPDIR (the
AppImage's folder), OWD (the folder it starts in) and, for AppRun, ARGV0.
A program named inside the AppImage instead of its AppRun gets APPDIR and
OWD too, besides the AppImage's libraries, so one that finds its files
through APPDIR does when a profile names it. A program in a plain folder
gets nothing of this. APPIMAGE is still never set.

The trail named only how many links an unpack left out (absolute ones, or
ones leading out of the AppImage). It now names the first five and where
they pointed, so a game that won't start for a missing file is found.

Tried on bazzite-kde with real releases: Shipwright, Savage Wind, SpartanPort,
Dusklight, Wind Waker HD, Melee, Super Mario World, Prime, LAS and MKW all
start from their unpacked folders with Easy Setup skipped, with APPDIR, OWD
and ARGV0 set. With Easy Setup on, Wind Waker HD, Ridge Racer Type 4, LAS and
UltraCombo start (UltraCombo's program named directly, with APPDIR and its
lib folder); the others ask for the player's copy first, as they should.
…yours run that way

The AppImages section now says why every Linux build of the launcher unpacks
an AppImage instead of running it: mounting needs FUSE (and can't happen in
the Flatpak at all), a mount is read-only and moves on every start, and
updates, saves and mods need a folder they can reach.

A new part, "Your AppImage has to run unpacked", asks for the same thing as a
tarball, with a way to try it (--appimage-extract, then AppRun with APPIMAGE
unset) and what makes it work: find files through APPDIR or /proc/self/exe,
bring libraries an rpath or AppRun finds, don't move yourself out of your
folder, don't bundle system libraries an AppRun's LD_LIBRARY_PATH would hand
to cp and mkdir, and keep links inside. The release rules and Recomp
Standards point there, and the AppRun bullets mention OWD and the links
left out.
@Xarishark
Xarishark marked this pull request as ready for review November 23, 2026 23:55
…e, and check an AppImage entry as its AppRun

A start.program or prepare.program that names a program inside an unpacked
AppImage (mkw-recomp's mkw) starts without its AppRun. The launcher gives it
the AppImage's library folders, APPDIR and OWD, but nothing else that AppRun
sets up. Developer tools now say so in yellow, and say when that's fine: when
the program runs on its own. They use the same appimage_root as the start code,
so the check and what Play does can't drift apart.

Checking a release's own recomplauncher.json, developer tools read it as
written, without the AppRun mapping Play applies (profile::to_apprun). So
every profile that names its AppImage, as the guide asks, got a red "None of
start.program is in this folder" once the AppImage was unpacked, while Play
started it fine. The file is now read as Play reads it.

The developer guide says when to name a program inside an AppImage and that
developer tools warn about it.

Tested on bazzite-kde with a debug build and real releases: MKW (profile names
mkw) shows "Play starts mkw" with the warning; Savage Wind (profile names its
AppImage) shows "Play starts AppRun --game", with no error. cargo test: 1019
passed, 4 of them new.
@elripalda
elripalda merged commit 394c233 into elripalda:main Nov 24, 2026
6 checks passed
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.

2 participants