feat/release-page #2

Merged
notazof merged 35 commits from feat/release-page into main 2026-08-17 19:56:11 +01:00
Showing only changes of commit cc48de0bea - Show all commits

Makefile: dpkg-architecture -aarm64 for proper cross-build host arch
Some checks failed
Forgejo Release postit-deb / release (push) Failing after 5m16s

dpkg-buildpackage doesn't know about dotnet's --runtime flag.
It uses the host arch by default, so the cross-build for arm64
produced postit_*_amd64.deb (filename mismatch with the actual
arm64 .so content inside).

The Debian-blessed way to do cross-builds is to set DEB_HOST_ARCH
via dpkg-architecture. With -aarm64, dpkg-buildpackage will:
- name the .deb postit_*_arm64.deb
- accept the amd64 host as the build environment
- run debhelper rules with the right DEB_* variables exported

The vars from dpkg-architecture have to be exported into the
same shell as dpkg-buildpackage (each make recipe line runs in
its own shell), so eval and dpkg-buildpackage are chained with
'\\' continuation.

The warning 'GNU system type aarch64-linux-gnu does not match
the CC system type x86_64-linux-gnu' is informational — it just
acknowledges that we're cross-compiling. We don't compile C, so
no CC toolchain is needed.
Paul Schneider 2026-08-17 17:48:47 +01:00
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B

View file

@ -42,6 +42,27 @@ deb:
# pattern would otherwise be re-used by dpkg-deb if the
# previous run left it lying around).
rm -f ../postit_*$(POSTIT_GIT_TAG)-1*.deb ../postit_*.buildinfo ../postit_*.changes
# Use dpkg-architecture to set the target arch correctly for
# cross-builds. For POSTIT_RUNTIME=linux-arm64, this exports
# DEB_HOST_ARCH=arm64 (and friends) so dpkg-buildpackage names
# the .deb postit_*_arm64.deb instead of postit_*_amd64.deb.
# For linux-x64, it sets the host arch to amd64 explicitly
# (which matches the runner — no-op, but keeps the call site
# uniform). Other RIDs are rejected.
case "$(POSTIT_RUNTIME)" in
linux-arm64) DPKG_ARCH_ARGS="-aarm64" ;;
linux-x64) DPKG_ARCH_ARGS="-aamd64" ;;
*) echo " ERROR: unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;;
esac
# dpkg-architecture with no -t/-a flags just prints the arch
# info; with -aarm64, it exports the variables needed for a
# cross-build targeting arm64. Use 'eval' to put those vars
# in the environment of the next command.
# Chain 'eval' and 'dpkg-buildpackage' on a single shell line
# so the exported vars from dpkg-architecture are visible
# to dpkg-buildpackage. Each recipe line runs in its own
# shell, so an 'eval' on one line wouldn't affect the next.
eval $(dpkg-architecture $$DPKG_ARCH_ARGS) && \
POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) \
dpkg-buildpackage -us -uc -b
# dpkg-buildpackage already writes the produced .deb to