Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage: fix segfault #32

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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