release.yml: fail-fast on arm64 shlib install + sanity check
Some checks failed
Forgejo Release postit-deb / release (push) Failing after 2m16s

When the apt-get install of arm64 shlibs fails silently (e.g.
because the configured apt sources don't include arm64 for some
packages), the next build step still tries to cross-build for
arm64 and dpkg-shlibdeps aborts. The Makefile's mv pattern then
matches the previous amd64 .deb (same filename prefix), exits 0,
and the missing arm64 .deb is only discovered later in the
'Localiser les .deb' step.

This adds:
- explicit set -e so any failure aborts the step cleanly
- `dpkg --add-architecture arm64` with fail-fast on error
- pre-flight apt-cache show check for each arm64 package
- explicit fail-fast on apt-get install failure
- dpkg -l sanity check to confirm the libs are installed

If the arm64 packages really are not available from the configured
apt sources, the workflow will now fail with a clear message
instead of producing a half-broken release.
This commit is contained in:
Paul Schneider 2026-08-17 17:13:39 +01:00
commit cbb7915907
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B

View file

@ -83,12 +83,27 @@ jobs:
# host. We add arm64 as a foreign architecture and pull # host. We add arm64 as a foreign architecture and pull
# them in. --no-install-recommends keeps the install # them in. --no-install-recommends keeps the install
# surface minimal. # surface minimal.
dpkg --add-architecture arm64 set -e
dpkg --add-architecture arm64 || { echo "::error::dpkg --add-architecture arm64 failed"; exit 1; }
apt-get update apt-get update
# Verify each arm64 package is actually installable. Bail
# early with a clear message if any are missing from the
# configured apt sources — silent apt-get install
# failures are the worst kind of workflow bug.
for pkg in libc6:arm64 libstdc++6:arm64 \
libfontconfig1:arm64 libfreetype6:arm64 \
libgtk-3-0:arm64; do
if ! apt-cache show "$pkg" >/dev/null 2>&1; then
echo "::error::arm64 package '$pkg' is not available in apt sources"
exit 1
fi
done
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
libc6:arm64 libstdc++6:arm64 \ libc6:arm64 libstdc++6:arm64 \
libfontconfig1:arm64 libfreetype6:arm64 \ libfontconfig1:arm64 libfreetype6:arm64 \
libgtk-3-0:arm64 libgtk-3-0:arm64 || { echo "::error::Failed to install arm64 shlibs"; exit 1; }
# Sanity-check: the libs must be visible to dpkg-shlibdeps.
dpkg -l libc6:arm64 libstdc++6:arm64 | tail -3
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
: > "$STATE_FILE" : > "$STATE_FILE"