Skip to content

Commit cc7d12d

Browse files
committed
fix(release): verify packaged Linux executables
1 parent 0384a2f commit cc7d12d

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ jobs:
5151
- name: Install build and packaging dependencies
5252
run: |
5353
sudo apt-get update
54-
sudo apt-get install -y libfontconfig1-dev libxkbcommon-x11-dev pkg-config rpm
54+
sudo apt-get install -y \
55+
libfontconfig1-dev libxkbcommon-x11-dev pkg-config rpm xauth xvfb
5556
- name: Download pinned AppImage tools
5657
shell: bash
5758
run: |

scripts/package-linux.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,18 @@ sed 's|@EXEC@|bootable-desktop|g' \
138138
> "$appdir/usr/share/applications/app.bootable.Bootable.desktop"
139139
# The adjacent helper lets the runtime retain its fixed-name fallback inside the AppImage.
140140
install -m 0755 "$binary_dir/bootable-helper" "$appdir/usr/bin/bootable-helper"
141-
"$linuxdeploy" \
141+
# linuxdeploy bundles an older strip that rejects RELR sections found in
142+
# current distro libraries. Dependency deployment does not require stripping.
143+
NO_STRIP=1 "$linuxdeploy" \
142144
--appdir "$appdir" \
143145
--executable "$appdir/usr/bin/bootable-desktop" \
144146
--executable "$appdir/usr/bin/bootable" \
145147
--executable "$appdir/usr/bin/bootable-helper" \
146148
--desktop-file "$appdir/usr/share/applications/app.bootable.Bootable.desktop" \
147149
--icon-file "$appdir/usr/share/icons/hicolor/scalable/apps/bootable.svg"
150+
# linuxdeploy points AppRun at the desktop executable. Remove that symlink before
151+
# writing the dispatcher, or shell redirection replaces the desktop binary.
152+
rm -f "$appdir/AppRun"
148153
cat > "$appdir/AppRun" <<'EOF'
149154
#!/bin/sh
150155
set -eu

scripts/verify-linux-packages.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,39 @@ trap 'rm -rf "$extract"' EXIT
3333
for path in AppRun usr/bin/bootable usr/bin/bootable-desktop usr/bin/bootable-helper; do
3434
test -x "$extract/squashfs-root/$path"
3535
done
36+
test -f "$extract/squashfs-root/AppRun"
37+
test ! -L "$extract/squashfs-root/AppRun"
38+
test ! "$extract/squashfs-root/AppRun" -ef "$extract/squashfs-root/usr/bin/bootable-desktop"
39+
test "$(od -An -N4 -t x1 "$extract/squashfs-root/usr/bin/bootable-desktop" | tr -d ' \n')" = "7f454c46"
3640
test "$("$extract/squashfs-root/usr/bin/bootable" --version)" = "bootable $version"
41+
test "$("$appimage" --tui --version)" = "bootable $version"
42+
43+
smoke="$extract/gui-smoke"
44+
install -d "$smoke/home" "$smoke/config" "$smoke/cache" "$smoke/data" "$smoke/state"
45+
install -d -m 0700 "$smoke/runtime"
46+
set +e
47+
env \
48+
HOME="$smoke/home" \
49+
XDG_CONFIG_HOME="$smoke/config" \
50+
XDG_CACHE_HOME="$smoke/cache" \
51+
XDG_DATA_HOME="$smoke/data" \
52+
XDG_STATE_HOME="$smoke/state" \
53+
XDG_RUNTIME_DIR="$smoke/runtime" \
54+
timeout --signal=TERM 5s xvfb-run -a "$extract/squashfs-root/AppRun" \
55+
>"$smoke/bootable.log" 2>&1
56+
status=$?
57+
set -e
58+
if [ "$status" -ne 124 ]; then
59+
cat "$smoke/bootable.log"
60+
echo "AppImage GUI exited before the five-second smoke window (status $status)" >&2
61+
exit 1
62+
fi
3763

3864
mkdir "$extract/archive"
3965
tar -xzf "$archive" -C "$extract/archive"
4066
for executable in bootable bootable-desktop bootable-helper install.sh; do
4167
test -x "$extract/archive/$executable"
4268
done
69+
test "$(od -An -N4 -t x1 "$extract/archive/bootable-desktop" | tr -d ' \n')" = "7f454c46"
4370
test "$("$extract/archive/bootable" --version)" = "bootable $version"
4471
"$extract/archive/bootable" --help >/dev/null

0 commit comments

Comments
 (0)