workflow: crossbuild-essential-arm64 + CONFIG_SITE
Some checks failed
Forgejo Release postit-deb / release (push) Failing after 3m59s

The previous two attempts (wget + dpkg-deb -x from packages.debian.org,
apt-get install libc6:arm64) were wrong approaches. The
Debian-recommended way is the crossbuild-essential-<ARCH> meta-package,
which pulls in:

  - gcc-aarch64-linux-gnu / g++-aarch64-linux-gnu (cross-gcc, unused
    for our managed-only build but installed for consistency)
  - binutils-aarch64-linux-gnu (provides aarch64-linux-gnu-objdump
    needed by dh_makeshlibs — replaces the previous binutils-only
    install)
  - libc6-dev:arm64, linux-libc-dev:arm64 (cross-libc for dpkg-shlibdeps
    to resolve the arm64 binaries' NEEDED entries against the system
    shlibs cache)
  - dpkg-cross CONFIG_SITE files under /etc/dpkg-cross/

With crossbuild-essential-arm64 installed:
  - dh_makeshlibs finds its aarch64-linux-gnu-objdump ✓
  - dh_shlibdeps can resolve arm64 binaries against the on-host shlibs
    cache ✓
  - dpkg-buildpackage -Pcross,nocheck runs cleanly

The environment for the arm64 make deb is now:

  CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64 \
    DEB_HOST_ARCH=arm64 DEB_BUILD_ARCH=amd64 \
    DEB_BUILD_OPTIONS=nocheck \
    make deb POSTIT_GIT_TAG= POSTIT_RUNTIME=linux-arm64

which matches the Debian cross-build recipe documented at
https://wiki.debian.org/CrossCompiling (Build without a build
environment section).

debian/rules also drops the now-unused override_dh_shlibdeps
override (the stage dir hack) — standard dh_shlibdeps now
works because the cross-libc is installed.
This commit is contained in:
Paul Schneider 2026-08-17 19:26:11 +01:00
commit 41ab11d7b9
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B
2 changed files with 32 additions and 96 deletions

21
debian/rules vendored
View file

@ -126,21 +126,12 @@ override_dh_auto_test:
# client). Build smoke is sufficient for the package.
override_dh_shlibdeps:
# If a stage of arm64 libraries has been extracted into
# $(ARM64_STAGE)/usr/lib/aarch64-linux-gnu/ (by the
# upstream fetch-arm64-libs.sh script wired into the
# Forgejo Actions workflow), point dpkg-shlibdeps at it
# with -l so it can resolve ELF NEEDED entries from the
# arm64 binaries (libc.so.6, libstdc++.so.6, etc.) without
# installing arm64 on the amd64 host.
if [ -n "$(ARM64_STAGE)" ] && [ -d "$(ARM64_STAGE)/usr/lib/aarch64-linux-gnu" ]; then \
echo " --> dpkg-shlibdeps: using arm64 stage at $(ARM64_STAGE)"; \
dh_shlibdeps -- -l"$(ARM64_STAGE)/usr/lib/aarch64-linux-gnu"; \
else \
dh_shlibdeps -- \
--warnings=0 \
-l"$(DEB_HOST_MULTIARCH_DIR)" 2>/dev/null || true; \
fi
# The runner image installs crossbuild-essential-arm64, which
# provides libc6-dev:arm64 et al. plus dpkg-cross — enough
# for dh_shlibdeps to resolve the arm64 binaries' NEEDED
# entries against the system's shlibs cache directly. No
# stage dir, no -l hack: standard dh_shlibdeps just works.
dh_shlibdeps
override_dh_strip:
# dh_strip disabled entirely. See MEMORY.md / AGENTS.md for the