Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2f34118
Make workflows a bit saner.
Lord-Kamina Jul 24, 2025
d430e1a
fix stdin maybe?
Lord-Kamina Jul 24, 2025
4203343
update requirements.txt
Lord-Kamina Jul 24, 2025
8f665c4
Fix compression
Lord-Kamina Aug 3, 2025
0d2c1b5
Fix invalid escape sequence in loader regex
Lord-Kamina Jul 24, 2025
9a878da
Make sure bin folder exists
Lord-Kamina Jul 24, 2025
25273b3
Don’t try to parse invalid versions
Lord-Kamina Jul 25, 2025
b08b041
Add actual python version to environment.
Lord-Kamina Jul 25, 2025
2c21cf7
Add `APPIMAGE_BUILDER_REMOTE_REPO_OWNER` env variable
Lord-Kamina Aug 2, 2025
c5299bb
Update test environments
Lord-Kamina Aug 3, 2025
70ddb25
Leftover references to old OS versions
Lord-Kamina Aug 3, 2025
9cc101c
Get rid of setup.py
Lord-Kamina Aug 3, 2025
0daed53
Use a venv to run tests in containers.
Lord-Kamina Aug 3, 2025
9af6adb
AppRun2: Add symlink to fix compat runtime in Ubuntu
Lord-Kamina Aug 2, 2025
e7fea7a
Fix bash recipes
Lord-Kamina Aug 2, 2025
671aa57
Don't create broken symlinks in AppImageBuilder recipe
Lord-Kamina Aug 2, 2025
a95a20b
AppImageBuilder recipe:Add comp
Lord-Kamina Aug 2, 2025
782f2c7
DRY, saner, and more importantly: WORKING CI
Lord-Kamina Aug 2, 2025
0feb4b0
Add AppImage with debug runtime to artifacts.
Lord-Kamina Aug 4, 2025
cc5ac5f
Remove version from filename
Lord-Kamina Aug 4, 2025
fd60393
git safe.directory
Lord-Kamina May 8, 2026
d68bde2
Fix arch test failure
Lord-Kamina May 11, 2026
46c8aa3
Revert "Fix setup_runtime to use only versions…”
Lord-Kamina May 11, 2026
e898a44
CI: Bump version of canned actions
Lord-Kamina May 11, 2026
0582bc1
Update canned actions and OS images again.
Lord-Kamina Oct 23, 2026
45d90b1
Update requirements.txt again.
Lord-Kamina Oct 23, 2026
1b09a7b
Use lief instead of spawning readelf.
Lord-Kamina Oct 24, 2026
c2610ee
Hopefully fix paths inside artifacts
Lord-Kamina Oct 28, 2026
e52afb3
Use patchelf from repository instead of compiling manually.
Lord-Kamina Oct 28, 2026
6823a33
Explicitly use gnu-coreutils
Lord-Kamina Oct 29, 2026
79fb145
Fix logic for determining executables
Lord-Kamina Nov 1, 2026
2e8d86f
Add squashfs-root to gitignore
Lord-Kamina Nov 2, 2026
3996ef6
Extra pretty debug on top.
Lord-Kamina Nov 2, 2026
15272b1
set _PYTHON_SUBPROCESS_USE_POSIX_SPAWN=0
Lord-Kamina Nov 6, 2026
532abfb
Use script to nuke uutils
Lord-Kamina Nov 5, 2026
c83ae2f
https on recipes.
Lord-Kamina Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 217 additions & 0 deletions .github/replace-uutils-with-gnu-coreutils-ubuntu26.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
#!/usr/bin/env bash
# Building embedded images is broken under stock Ubuntu 26,
# because the rust coreutils version is severely broken, and doesnt react to bugreports.
# UEFI files get corrupted e.g.
# https://computingforgeeks.com/ubuntu-2604-rust-coreutils-guide/ is quite ok, but not fully.
#
# Replace Ubuntu 26's uutils selector with GNU coreutils while keeping
# build-essential dependent on the implementation-neutral coreutils package.
# Tested in a fresh Ubuntu-26.04 container

set -Eeuo pipefail
export DEBIAN_FRONTEND=${DEBIAN_FRONTEND:-noninteractive}

usage() {
cat <<'EOF'
Usage: sudo ./replace-uutils-with-gnu-coreutils-ubuntu26.sh [options]

Options:
--build-only Build the corrected build-essential package; do not install it.
--output-dir DIR Keep the corrected package in DIR (default: /var/tmp).
-h, --help Show this help.
EOF
}

build_only=false
output_dir=/var/tmp

while (($#)); do
case "$1" in
--build-only)
build_only=true
shift
;;
--output-dir)
(($# >= 2)) || { printf 'error: --output-dir requires a directory\n' >&2; exit 2; }
output_dir=$2
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
printf 'error: unknown option: %s\n' "$1" >&2
usage >&2
exit 2
;;
esac
done

if [[ ! -r /etc/os-release ]]; then
printf 'error: /etc/os-release is unavailable\n' >&2
exit 1
fi
# shellcheck disable=SC1091
. /etc/os-release
if [[ ${ID:-} != ubuntu || ${VERSION_ID:-} != 26.* ]]; then
printf 'error: this recipe is only for Ubuntu 26.x; found %s %s\n' \
"${ID:-unknown}" "${VERSION_ID:-unknown}" >&2
exit 1
fi

if ! $build_only && ((EUID != 0)); then
printf 'error: run the installation with sudo (or use --build-only)\n' >&2
exit 1
fi

for command in apt-cache apt-get awk dpkg dpkg-deb dpkg-query mktemp; do
command -v "$command" >/dev/null || {
printf 'error: required command not found: %s\n' "$command" >&2
exit 1
}
done

is_installed() {
[[ $(dpkg-query -W -f='${db:Status-Abbrev}' "$1" 2>/dev/null || true) == ii* ]]
}

installed_build_essential_depends=$(dpkg-query -W -f='${Depends}' build-essential 2>/dev/null || true)
if ! $build_only \
&& [[ $installed_build_essential_depends == *coreutils* ]] \
&& [[ $installed_build_essential_depends != *coreutils-from-uutils* ]] \
&& is_installed coreutils-from-gnu; then
printf 'Already configured: build-essential uses coreutils and coreutils-from-gnu is installed.\n'
exit 0
fi

if ! $build_only; then
apt-get update
fi

archive_version=$(apt-cache madison build-essential | awk 'NR == 1 { print $3 }')
if [[ -z $archive_version ]]; then
printf 'error: no archive version of build-essential is available\n' >&2
exit 1
fi
local_version="${archive_version}+coreutilsgnu1"
architecture=$(dpkg --print-architecture)

work_dir=$(mktemp -d "${TMPDIR:-/tmp}/build-essential-coreutils-gnu.XXXXXXXX")
cleanup() {
rm -rf "$work_dir"
}
trap cleanup EXIT
chmod 0755 "$work_dir"
download_dir=$work_dir/download
mkdir "$download_dir"
if ((EUID == 0)) && id -u _apt >/dev/null 2>&1; then
chown _apt:root "$download_dir"
fi

(
cd "$download_dir"
apt-get download "build-essential=$archive_version"
)

shopt -s nullglob
downloaded_packages=("$download_dir"/build-essential_*.deb)
shopt -u nullglob
if ((${#downloaded_packages[@]} != 1)); then
printf 'error: expected one downloaded build-essential package, found %d\n' \
"${#downloaded_packages[@]}" >&2
exit 1
fi

package_root=$work_dir/package
dpkg-deb --raw-extract "${downloaded_packages[0]}" "$package_root"
control_file=$package_root/DEBIAN/control
original_depends=$(dpkg-deb -f "${downloaded_packages[0]}" Depends)
if [[ $original_depends != *coreutils-from-uutils* ]]; then
printf 'error: archive build-essential no longer depends on coreutils-from-uutils; refusing to rewrite unexpected metadata\n' >&2
exit 1
fi

awk -v version="$local_version" '
/^Version: / {
print "Version: " version
next
}
/^Maintainer: / {
print "Maintainer: Local Administrator <root@localhost>"
next
}
/^Depends: / {
if (sub(/coreutils-from-uutils([[:space:]]*\([^)]*\))?/, "coreutils") != 1) {
exit 42
}
print
next
}
{ print }
' "$control_file" >"$control_file.new" || {
status=$?
printf 'error: failed to rewrite build-essential control metadata (status %d)\n' "$status" >&2
exit "$status"
}
mv "$control_file.new" "$control_file"

mkdir -p "$output_dir"
output_dir=$(cd "$output_dir" && pwd -P)
version_for_filename=${local_version//:/%3a}
output_package=$output_dir/build-essential_${version_for_filename}_${architecture}.deb
dpkg-deb --root-owner-group --build "$package_root" "$output_package"

rebuilt_depends=$(dpkg-deb -f "$output_package" Depends)
rebuilt_version=$(dpkg-deb -f "$output_package" Version)
if [[ $rebuilt_version != "$local_version" \
|| $rebuilt_depends == *coreutils-from-uutils* \
|| $rebuilt_depends != *coreutils* ]]; then
printf 'error: rebuilt package failed metadata validation\n' >&2
exit 1
fi

printf 'Built corrected package: %s\n' "$output_package"
printf 'Depends: %s\n' "$rebuilt_depends"

if $build_only; then
exit 0
fi

# Unpack first so this also works on minimal images where build-essential's
# compiler dependencies are not installed yet. Resolve those dependencies while
# uutils still satisfies coreutils' selector pre-dependency.
dpkg --unpack "$output_package"
apt-get --fix-broken install -y

# These selector packages conflict through their shared coreutils-from virtual
# package. Name the removal explicitly so APT can solve the handoff. Ubuntu marks
# the uutils selector Protected, so noninteractive replacement requires
# --allow-remove-essential; coreutils-from-gnu is installed in the same APT
# transaction and performs the supported diversion handoff.
apt-get install -y --allow-remove-essential \
coreutils-from-gnu coreutils-from-uutils-
apt-get check

if ! is_installed build-essential \
|| ! is_installed coreutils-from-gnu \
|| is_installed coreutils-from-uutils; then
printf 'error: package transition did not complete\n' >&2
exit 1
fi
installed_build_essential_depends=$(dpkg-query -W -f='${Depends}' build-essential)
if [[ $installed_build_essential_depends == *coreutils-from-uutils* \
|| $installed_build_essential_depends != *coreutils* ]]; then
printf 'error: installed build-essential has unexpected dependencies: %s\n' \
"$installed_build_essential_depends" >&2
exit 1
fi
if ! /usr/bin/ls --version 2>/dev/null | awk 'NR == 1 { found = /GNU coreutils/ } END { exit !found }'; then
printf 'error: /usr/bin/ls is not provided by GNU coreutils after the transition\n' >&2
exit 1
fi

printf 'Transition complete.\n'
printf ' build-essential: %s\n' "$(dpkg-query -W -f='${Version}' build-essential)"
printf ' selector: coreutils-from-gnu %s\n' "$(dpkg-query -W -f='${Version}' coreutils-from-gnu)"
printf ' active ls: %s\n' "$(readlink -f /usr/bin/ls)"
155 changes: 155 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Run tests

on:
workflow_call:
env:
APPIMAGE_BUILDER_REMOTE_REPO_OWNER: ${{ github.repository_owner }}

jobs:
pytest-ubuntu-container:
name: Run tests on Ubuntu 26.04 (Docker)
runs-on: ubuntu-26.04
container: ubuntu:26.04
steps:
- name: Install dependencies
run: |
apt-get -y update
apt-get install -y fakeroot lsb-release binutils patchelf git python3-dev python3-pip python3-venv libffi-dev
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up a virtualenv
run: |
python3 -m venv .venv
- name: Install appimage-builder and run tests
run: |
git config --global --add safe.directory $PWD
. .venv/bin/activate
pip install pytest
pip install -e .[dev]
pytest tests

pytest-archlinux:
name: Run tests on ArchLinux (Docker)
runs-on: ubuntu-26.04
container: archlinux
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm binutils fakeroot lsb-release strace patchelf git python-pip gcc
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up a virtualenv
run: |
python3 -m venv .venv

@james-lawrence james-lawrence May 9, 2026 •

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.

backout the sudo change and use git config --global --add safe.directory $PWD you dropped that command which is why you're seeing the ci errors about dubious ownership. I know its not optimal/feels dirty to have, but will get us over the initial merge hump and then it'll becomes my problem. =)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm trying out changes in the main branch of my fork. I am also going to update the canned action versions but I want to get this fixed first. I am now having another issue on arch, which seems stem from it trying to download non-existing signatures. I'm not really familiar enough with Arch to understand how to fix this:

https://github.com/Lord-Kamina/appimage-builder/actions/runs/25603560688/job/75161484580

error: failed retrieving file 'core.db.sig' from mirror.rackspace.com : The requested URL returned error: 404
error: failed to synchronize all databases (failed to retrieve some files)
------------------------------ Captured log setup ------------------------------
ERROR    root:shell.py:30 "['/usr/sbin/fakeroot', '/usr/sbin/pacman', '--config', '/tmp/pacman-venv/pacman.conf', '-Sy', '--quiet']" execution failed
______________ ERROR at setup of TestVenv.test_read_package_data _______________

cls = <class 'tests.modules.deploy.pacman.test_venv.TestVenv'>

    @classmethod
    def setUpClass(cls):
        cls.appdir_path = Path("/tmp/AppDir")
        cls.venv_path = Path("/tmp/pacman-venv")
        cls.pacman_venv = Venv(
            cls.venv_path,
            repositories={
                "core": ["https://mirror.rackspace.com/archlinux/$repo/os/$arch"]
            },
            architecture="auto",
        )
>       cls.pacman_venv.update()

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.

oi. interesting. most likely that mirror is out of sync/bad. since I actually run arch here is my current mirror list on my system. jsut replace it with some from here for now. that'll likely fix it.

################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################

# With:       reflector @/etc/xdg/reflector/reflector.conf
# When:       2026-05-09 13:49:03 UTC
# From:       https://archlinux.org/mirrors/status/json/
# Retrieved:  2026-05-09 13:49:03 UTC
# Last Check: 2026-05-09 13:27:16 UTC

Server = https://frankfurt.mirror.pkgbuild.com/$repo/os/$arch
Server = https://mirror.moson.org/arch/$repo/os/$arch
Server = https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
Server = https://arch.mirror.constant.com/$repo/os/$arch
Server = https://mirror.pseudoform.org/$repo/os/$arch
Server = https://mirror.kumi.systems/archlinux/$repo/os/$arch
Server = https://berlin.mirror.pkgbuild.com/$repo/os/$arch
Server = https://losangeles.mirror.pkgbuild.com/$repo/os/$arch
Server = https://de.arch.niranjan.co/$repo/os/$arch
Server = https://us.arch.niranjan.co/$repo/os/$arch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From what I was reading, it's a config issue because those sig files do not actually exist on mirrors.

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.

oh dear. well I'm more interested in ubuntu passing atm than arch. I'll happily cleanup arch after merging this.

- name: Install appimage-builder and run tests
run: |
git config --global --add safe.directory $PWD
. .venv/bin/activate
pip install pytest
pip install -e .[dev]
pytest tests

pytest-ubuntu-runner:
name: Run tests on Ubuntu 26.04 with python 3.14.
runs-on: ubuntu-26.04
steps:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get install -y fakeroot lsb-release binutils patchelf git libffi-dev
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Clear Python cache
run: |
sudo rm -rf /__t/Python
- name: Install python
uses: actions/setup-python@v7
with:
python-version: '3.14'
cache: 'pip'
- name: Install appimage-builder and run tests
run: |
pip install pytest
pip install -e .[dev]
python3 -m pytest tests

build-pack-bash:
runs-on: ubuntu-26.04
needs: [ pytest-ubuntu-container, pytest-ubuntu-runner, pytest-archlinux ]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
chmod +x .github/replace-uutils-with-gnu-coreutils-ubuntu26.sh
sudo ./.github/replace-uutils-with-gnu-coreutils-ubuntu26.sh
sudo apt-get install -y gnu-coreutils coreutils-from-gnu coreutils-from-uutils- rust-coreutils- coreutils patchelf desktop-file-utils libgdk-pixbuf-2.0-dev fakeroot strace git lsb-release python3-build python3-setuptools adwaita-icon-theme libffi-dev

sudo wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
sudo chmod +x /usr/local/bin/appimagetool
- name: Build Python Wheel
run: |
cd ${{ github.workspace }}
python3 -m build
- name: Install appimage-builder
run: |
pip install --ignore-installed --user --break-system-packages .
- name: Build AppImage
run: |
cd ${{ github.workspace }}/recipes/appimage-builder
export APPIMAGE_BUILDER_VERSION=$(appimage-builder --version | head -1 | cut -f 2 -d" ")
echo "APPIMAGE_BUILDER_VERSION=${APPIMAGE_BUILDER_VERSION}" >> $GITHUB_ENV
appimage-builder --skip-test
- name: Pack bash
run: |
# build bash
BUILDER_PATH=$(find $PWD -name appimage-builder-*.AppImage)
chmod +x "$BUILDER_PATH"
cd ${{ github.workspace }}/recipes/bash/
"$BUILDER_PATH" --skip-test
- name: Test bash
run: |
cd ${{ github.workspace }}/recipes/bash/
./bash*.AppImage --appimage-extract-and-run -c "echo Hello World"
- name: Build AppImage (DEBUG runtime)
run: |
cd ${{ github.workspace }}/recipes/appimage-builder
appimage-builder --skip-test --recipe ./AppImageBuilder-debug.yml
- name: Compress Assets
run: |
cd ${{ github.workspace }}/recipes/appimage-builder
tar -cvf appimage-builder_x86_64-AppImage.tar -C ${{ github.workspace }}/recipes/appimage-builder/ *x86_64.AppImage*
tar -cvf appimage-builder_x86_64-AppImage-DEBUG.tar -C ${{ github.workspace }}/recipes/appimage-builder/ *-DEBUG.AppImage*
tar -cvf ${{ github.workspace }}/appimage-builder_python-dist.tar -C ${{ github.workspace }}/dist .
- name: Upload AppImageBuilder AppImage
uses: actions/upload-artifact@v7
with:
name: appimage-builder.AppImage
path: '${{ github.workspace }}/recipes/appimage-builder/appimage-builder_x86_64-AppImage.tar'
retention-days: 7
- name: Upload AppImageBuilder Debug AppImage
uses: actions/upload-artifact@v7
with:
name: appimage-builder-DEBUG.AppImage
path: '${{ github.workspace }}/recipes/appimage-builder/appimage-builder_x86_64-AppImage-DEBUG.tar'
retention-days: 7
- name: Upload AppImageBuilder Python dist
uses: actions/upload-artifact@v7
with:
name: appimage-builder-pydist
path: '${{ github.workspace }}/appimage-builder_python-dist.tar'
retention-days: 7
- name: Upload Bash AppImage
uses: actions/upload-artifact@v7
with:
name: bash.AppImage
path: '${{ github.workspace }}/recipes/bash/*.AppImage*'
retention-days: 7
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "CI Build"

on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
name: "Build and test"
uses: ./.github/workflows/build-test.yml
Loading