Skip to content

Commit

Permalink
AppImage: fix segfault (#32)
Browse files Browse the repository at this point in the history
* fix(appimage): fix segfault caused by glibc 2.39
  • Loading branch information
git-developer authored Sep 28, 2024
1 parent 037a5d6 commit 3289a9d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 29 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@ jobs:
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}"
- name: Build AppImage
uses: AppImageCrafters/[email protected]
uses: git-developer/[email protected]
with:
recipe: "${{ matrix.base.recipe }}"
command: ${{
format('sh -c "set -eu; {0}; {1}; {2}; appimage-builder --recipe {3}"',
'pip install --upgrade setuptools packaging packaging-legacy',
'pip install --extra-index-url https://lief.s3-website.fr-par.scw.cloud/latest \"lief>=0.16.0.dev0\"',
'find /usr/local/lib -name package.py | while read -r file; do sed -i -e \"s/^from.packaging/&_legacy/\" \"${file}\"; done',
matrix.base.recipe)
}}

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
9 changes: 7 additions & 2 deletions AppImageBuilder.debian-bullseye.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ AppDir:
pip install --target "${TARGET_APPDIR}/usr/lib/python3/dist-packages/" vdf
fi
# python3-usb1 expects 'libusb-1.0.so', see https://github.com/vpelletier/python-libusb1/issues/78
find "${TARGET_APPDIR}" -name 'libusb-1.0.so.[0-9]' | while read -r file; do
path="$(dirname "${file}")"
link="${file%.[0-9]}"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
apt:
arch:
- "{{APPIMAGE_APT_ARCH}}"
Expand Down Expand Up @@ -104,8 +111,6 @@ AppDir:

exclude:
# coreutils
- libacl* # filesystem
- libattr* # filesystem
- libgmp* # arithmetics

# gir1.2-rsvg-2.0
Expand Down
19 changes: 15 additions & 4 deletions AppImageBuilder.debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ AppDir:
printf '[Settings]\ngtk-icon-theme-name = %s\n' "${theme}" >"${xdg_settings}"
fi
# python3-usb1 expects 'libusb-1.0.so', see https://github.com/vpelletier/python-libusb1/issues/78
find "${TARGET_APPDIR}" -name 'libusb-1.0.so.[0-9]' | while read -r file; do
path="$(dirname "${file}")"
link="${file%.[0-9]}"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
# Trixie expects libpixbufloader libs with a dash suffix, not underscore
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1082676
find "${TARGET_APPDIR}" -type f -name 'libpixbufloader_*' | while read -r file; do
path="$(dirname "${file}")"
link="${path}/$(echo "$(basename "${file}")" | tr _ -)"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
after_runtime: |
set -eu
Expand Down Expand Up @@ -109,8 +124,6 @@ AppDir:

exclude:
# coreutils
- libacl* # filesystem
- libattr* # filesystem
- libgmp* # arithmetics

# gir1.2-rsvg-2.0
Expand All @@ -134,7 +147,6 @@ AppDir:
- libfribidi* # i18n
- libgtk-3-common # gui
- liblz* # codec
- libmount* # filesystem
- libtiff* # codec
- libwebp* # codec

Expand All @@ -156,7 +168,6 @@ AppDir:
- libgprofng* # development
- libjansson* # codec
- libsframe* # development
- libcloudproviders* # networking
- netbase # network
- tzdata # date/time

Expand Down
25 changes: 9 additions & 16 deletions AppImageBuilder.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ RUN <<EOR
return 1
}

handle_failure() {
return_code="${1}"
file="${2}"
if [ "${return_code}" = 139 ] && echo "${file}" | grep -q -P -- '-(noble|trixie|bookworm)-'; then
log "Ignoring failure ${return_code} for ${file}" \
"which is currently known to cause a segmentation fault"
else
return "${return_code}"
fi
}

prepare() {
if command -v apt-get >/dev/null; then
apt-get update && apt-get install -y --no-install-recommends libx11-6
Expand All @@ -43,15 +32,19 @@ RUN <<EOR
cancel "Error: No AppImage file found."
fi
prepare
config_path="${HOME}/.config/scc"
mkdir -p "${config_path}"
echo '{}' >"${config_path}/config.json"

echo "${files}" | while read -r file; do
log "${file}"
log "Testing ${file}"
chmod +x "${file}"
rm -rf squashfs-root/
"${file}" --appimage-extract >/dev/null
(
cd squashfs-root/runtime/compat
{ ../../AppRun dependency-check && ../../AppRun daemon --help; } || handle_failure "$?" "${file}"
)
cd squashfs-root/runtime/compat
../../AppRun dependency-check
output=$(../../AppRun daemon --help 2>&1 | tee -a /dev/stderr)
if echo "${output}" | grep -q Error; then return 1; fi
rm -f "${file}"
done
}
Expand Down
9 changes: 7 additions & 2 deletions AppImageBuilder.ubuntu-focal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ AppDir:
printf '[Settings]\ngtk-icon-theme-name = %s\n' "${theme}" >"${xdg_settings}"
fi
# python3-usb1 expects 'libusb-1.0.so', see https://github.com/vpelletier/python-libusb1/issues/78
find "${TARGET_APPDIR}" -name 'libusb-1.0.so.[0-9]' | while read -r file; do
path="$(dirname "${file}")"
link="${file%.[0-9]}"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
apt:
arch:
- "{{APPIMAGE_APT_ARCH}}"
Expand Down Expand Up @@ -108,8 +115,6 @@ AppDir:

exclude:
# coreutils
- libacl* # filesystem
- libattr* # filesystem
- libgmp* # arithmetics

# gir1.2-rsvg-2.0
Expand Down
10 changes: 7 additions & 3 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ AppDir:
printf '[Settings]\ngtk-icon-theme-name = %s\n' "${theme}" >"${xdg_settings}"
fi
# python3-usb1 expects 'libusb-1.0.so', see https://github.com/vpelletier/python-libusb1/issues/78
find "${TARGET_APPDIR}" -name 'libusb-1.0.so.[0-9]' | while read -r file; do
path="$(dirname "${file}")"
link="${file%.[0-9]}"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
after_runtime: |
set -eu
Expand Down Expand Up @@ -111,8 +118,6 @@ AppDir:

exclude:
# coreutils
- libacl* # filesystem
- libattr* # filesystem
- libgmp* # arithmetics

# gir1.2-rsvg-2.0
Expand All @@ -136,7 +141,6 @@ AppDir:
- libfribidi* # i18n
- libgtk-3-common # gui
- liblz* # codec
- libmount* # filesystem
- libtiff* # codec
- libwebp* # codec

Expand Down

0 comments on commit 3289a9d

Please sign in to comment.