Skip to content

Many fixes, come inside for a better explanation - #383

Merged
Lord-Kamina merged 36 commits into
AppImageCrafters:mainfrom
Lord-Kamina:fix-deps-final
Nov 9, 2026
Merged

Lord-Kamina merged 36 commits into
AppImageCrafters:mainfrom
Lord-Kamina:fix-deps-final

Conversation

@Lord-Kamina

Copy link
Copy Markdown
Contributor

First, sorry for an idiotically big PR... I began working on this when our workflows at https://www.github.com/performous/performous broke recently.

This is part of a larger effort to give whoever steps up as maintainer (I'm not it!) an all-around easier time. It partly relies on other PRs I have submitted at https://github.com/AppImageCrafters/AppRun and https://github.com/AppImageCrafters/tests-env

Here, I have done a number of changes:

  1. I have fixed the testing suite.
  2. I have added two environment variables:
  • APPIMAGE_BUILDER_PY_VERSION: This will be set automatically when running the script, and it's populated from sys.version_info. The idea is to use this in python recipes, and then you don't need to update them when there are updates to python.
  • APPIMAGE_BUILDER_REMOTE_REPO_OWNER: This will hold the repository-owner for any parts of the code that download or reference things from other repos. The idea is if somebody forks all three repos (appimage-builder, AppRun and tests-env) they can still have CI working on their forks. It's populated from the environment in __main__.py (and the CI workflows by default set it to ${{ github.repository_owner }}, with appimagecrafters as a default fallback.
  1. Modernize the python project by updating all requirements and getting rid entirely of the setup.py, migrating completely to pyproject.toml
  2. Fixes a few things in the appimage-builder and bash recipes.
  3. Many fixes and refactoring to the actions workflows, which will result in you having a saner and working CI pipeline again.
  4. I was working on fixing the compression thing in parallel to what got merged, it seems. I am making a change to that as well by defaulting to zstd because, according to the AppImage team, that should be the standard, as per XZ compression is broken #378

Below I will paste my explanation to a teammate of why I had to change some things in AppRun, as well as the structure of symlinks.

[20:45]Lord Kamina: The reason my builds were failing and the old ones are working is because the "compatibility" runtime is broken
[20:51]Lord Kamina: The way the compatibility thing works is, it bundles the glibc from the build machine in the AppImage
[20:52]Lord Kamina: And at runtime it compares the bundled and host glibc versions
[20:53]Lord Kamina: If the system's is newer, it uses that and if not it uses the bundled or "compatibility"
[20:53]Lord Kamina: But the compat version is broken for ubuntu at least
[20:54]Lord Kamina: Because ubuntu expects the ld-linux linker to be in /lib64
[20:55]Lord Kamina: And that symlink is not created by appimage-builder because it's a pretty non-standard location
[20:56]Lord Kamina: So you try to fire it, it can't find it and it fails with the "no such file error", which is just strerr(ENOENT)
[20:58]Lord Kamina: The reason the old appimages work is because they have ancient glibc versions so it just selects the normal os runtime
[20:58]Lord Kamina: But there's a bug in the comparison, it compares if system > bundled
[20:59]Lord Kamina: So when they're the same, it tries to use the broken bundled runtime, and that's why our CI was failing

This will probably take a while to digest and be reviewed properly but I'm willing to answer any questions.
In the meantime, you can go over to my fork and see how the CI works and download what should be a working appimage-builder AppImage made with python 3.12

@james-lawrence

Copy link
Copy Markdown
Contributor

@Lord-Kamina would you be willing to refresh this off main? Its fine if not, but it'd be helpful, I plan on taking care of this on saturday for review/integrating.

@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

Will do when I have some time.

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Seems I was working on this in parallel to what got merged.

My reasoning is this: Use the expanded `-noX` commands that mean the same as `—no-compresion` according to the documentation.

By default use zstd compression instead of xz, because the AppImage team has said on at least one occassion that’s what’s going in the standard spec.

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

There's something here that actually needs some discussion @james-lawrence.

re: The pydpkg update that enforces numeric versions... What I did was just add logic to side-step the bug by not trying to parse invalid versions. It works on my fork, and it allows to keep using the "continuous" tag. By contrast, #346 just changed "continuous" to 2.0.0, but I'm not sure that's the best idea.

P.S. that PR also hard-coded gzip compression, which is no longer supported.

Lord-Kamina added 11 commits May 7, 2026 15:30
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
This doesn't change the default behavior, but makes the whole workflow much more friendly for people forking this and other AppImageCrafters repos.
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
debug?

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>

don't need debug anymore
@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

@james-lawrence can you check again as to whether you can review/merge in the other repos? I was looking at another PR in the AppRun repo and it did show me the "submit review" button when I went into detail on the code changes, so you might be able to do it too.

@Cacodemon345

Copy link
Copy Markdown

I believe I ran into the exact same problem a while ago as described in the PR text while I was looking into migrating a program from Debian Bullseye to Debian Trixie. It'd be lovely to see this dealt with.

@james-lawrence

Copy link
Copy Markdown
Contributor

@azubieta bump again ;)

@Lord-Kamina still nada.
image
image

@james-lawrence

Copy link
Copy Markdown
Contributor

@Cacodemon345 this might help you, working setup that uses latest in this repository.

# Resolute has a number of third party bugs we've worked around:
#
# THIRD PARTY BUG: appimage-builder throws APPRUN_ERROR (ENOENT) on launch.
# appimage-builder installs the dynamic linker into runtime/compat/usr/lib64/ but
# fails to generate the root-level lib64 symlink the AppRun runtime expects to
# find it at. Fixed below via after_runtime, which creates the missing symlink
# once runtime/compat/ has been populated but before the AppDir is packaged.
#
# THIRD PARTY BUG: libass crashes with "undefined symbol: FcConfigSetDefaultSubstitute"
# on launch. libass is pulled in transitively via ffmpeg8/libavfilter, and needs a
# fontconfig new enough to export FcConfigSetDefaultSubstitute (fontconfig >= 2.17).
# appimage-builder excludes fontconfig from the bundle by default, leaving it to
# resolve against whatever fontconfig the host has, which is commonly older than
# that. We bundle libfontconfig1/fontconfig-config explicitly from the same apt
# snapshot libass comes from -- we don't want to rely on host libraries when we
# can avoid it.
#
# THIRD PARTY BUG: (worked around by replacement, not a runtime patch): GTK's
# icon-theme rendering routes SVG loading through glycin, which spawns a sandboxed
# helper at a hardcoded absolute path (e.g. /usr/libexec/glycin-loaders/2+/glycin-svg).
# AppImage's mount doesn't remap /usr the way Flatpak's sandbox does, so that lookup
# always hits the real host filesystem, which usually doesn't have glycin at that
# exact path -- and even a bwrap-relaunch grafting the bundle's own glycin-loaders in
# still crashes on hosts missing the loader binaries' own dependency closure (they
# have no RPATH). Rather than patch around that, apt.exclude the stock
# glycin/glycin-loaders/libglycin-2-0 packages and apt.include glycin-ng instead: a
# from-scratch, permissively-licensed reimplementation (github.com/QaidVoid/glycin-ng,
# packaged in .eg/debuild/glycinng) that decodes in-process (Landlock/seccomp on a
# worker thread) instead of spawning subprocess helpers, so this whole class of bug
# doesn't apply. It ships a same-ABI libglycin-2.so.0 shim, so nothing downstream
# (gdk-pixbuf/GTK) needs to change.

version: 1

AppDir:
  path: !ENV "${APPDIR}"

  app_info:
    id: space.retrovibe.Console
    name: retrovibed
    icon: space.retrovibe.Console
    version: !ENV "${VERSION}"
    exec: usr/lib/retrovibed/retrovibed
    exec_args: $@

  after_runtime: |
    mkdir -p "${APPDIR}/runtime/compat/lib64"
    ln -sf ../usr/lib64/ld-linux-x86-64.so.2 "${APPDIR}/runtime/compat/lib64/ld-linux-x86-64.so.2"

  apt:
    arch: !ENV "${APT_ARCH}"
    sources:
      - sourceline: "deb https://archive.ubuntu.com/ubuntu/ resolute main restricted universe multiverse"
        key_url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
      - sourceline: "deb https://archive.ubuntu.com/ubuntu/ resolute-updates main restricted universe multiverse"
        key_url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
      - sourceline: "deb https://archive.ubuntu.com/ubuntu/ resolute-backports main restricted universe multiverse"
        key_url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
      - sourceline: "deb http://security.ubuntu.com/ubuntu resolute-security main restricted universe multiverse"
        key_url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
      - sourceline: "deb https://ppa.launchpadcontent.net/jljatone/retrovibed/ubuntu resolute main"
        key_url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x872D11DA822A34E7E8499E6DA953F6DC11C77486"
    include:
      - libgtk-3-0t64
      - libglu1-mesa
      - librsvg2-common
      - dash
      - bash
      - perl
      - libfontconfig1
      - fontconfig-config
      - humanity-icon-theme
      - hicolor-icon-theme
      - adwaita-icon-theme
      - ubuntu-mono
      - glycin-ng
    exclude:
      - libglib2.0-data
      - libglycin-2-0
      - glycin-loaders

  files:
    exclude:
      - usr/share/man
      - usr/share/doc
      - usr/share/bash-completion

AppImage:
  comp: zstd
  arch: !ENV "${APPIMAGE_ARCH}"
  update-information: !ENV "gh-releases-zsync|retrovibed|retrovibed|latest|retrovibed-*-${APPIMAGE_ARCH}.AppImage.zsync"
  file_name: !ENV "${APPIMAGE_FILE_NAME}"

@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

@james-lawrence is there anywhere I might contact you to ask your opinion on something? Or alternatively, if you don't want to give out contact details, you can find a few of my accounts on my profile.

@james-lawrence

Copy link
Copy Markdown
Contributor

@Lord-Kamina absolutely. sent you an email.

Debian Trixie
Ubuntu Resolute
Fedora 44

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
@Lord-Kamina
Lord-Kamina marked this pull request as draft October 28, 2026 17:56
@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

Converted to draft for a bit, because I seem to have broken something.

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
The old versions of appimage-builder relied on accidentally correct behavior through faulty logic.

The app looked for a `_start` symbol via substring matching, which ended up giving false positives by matching `__gmon_start__`.

Changing the logic to use lief eliminated that, and only binaries with an actual `_start_` had the location of the dynamic linker patched, leaving us with a half-working AppImage.

The problem here is that most stripped ELF binaries don’t have `_start_` but rather enter through a memory address located in the header.

So instead, let’s just look for the interpreter and patch it if it’s found.

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

@james-lawrence, are you still interested in this?
Now that we do both have the necessary privileges, and the build is working again, I'll probably merge the AppRun PR and this tonight or sometime this weekend.

@james-lawrence

Copy link
Copy Markdown
Contributor

indeed i am though fairly swamped atm =) sounds like a plan.

@james-lawrence
james-lawrence marked this pull request as ready for review November 7, 2026 21:04
@james-lawrence

Copy link
Copy Markdown
Contributor

(and yes looks like our permissions are correct! yay!)

@Lord-Kamina
Lord-Kamina merged commit 3c96314 into AppImageCrafters:main Nov 9, 2026
4 checks passed
@Lord-Kamina
Lord-Kamina deleted the fix-deps-final branch November 9, 2026 12:42
@Lord-Kamina

Copy link
Copy Markdown
Contributor Author

@james-lawrence There are of course, many things to be fixed still. Looking further into what things can be done to minimize spawning shell processes comes to mind. Still, I've merged it for now because I think the continuous build is at least functional for common usage. I would like your opinion on whether you want to draft a release, or fix/add stuff before we get to that.

@james-lawrence

Copy link
Copy Markdown
Contributor

@Lord-Kamina indeed there are. I'm a fan of getting a couple fixes out first before drafting a release. I'd like at least the projects I have building properly without the hacks i've had to insert into the yaml to get it working. (proper linking for alternative architectures for example)

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.

4 participants