Files
photocraft/packaging/freebsd
Dylan M. Taylor 8988161e90 Honor CARGO_BUILD_TARGET in FreeBSD packaging for aarch64 release builds (#9989)
* Honor CARGO_BUILD_TARGET in FreeBSD packaging for aarch64 release builds

package.sh took the arch from uname -m. The release VM is an x86_64 guest that
cross-compiles aarch64 with CARGO_BUILD_TARGET set, so an aarch64 build was
named freebsd-x86_64 and read binaries from the host target dir.

Read the arch from CARGO_BUILD_TARGET when it is set, and read binaries from
target/<triple>/release. Skip the man-page example and the --version run when
cross-building, since the aarch64 binaries cannot run on the x86_64 guest.
Unset CARGO_BUILD_TARGET keeps the old behavior.

* Reject unsupported CARGO_BUILD_TARGET and resolve host-tuple in FreeBSD packaging

Accept only x86_64-unknown-freebsd and aarch64-unknown-freebsd. Any other
target exits 2 before any build, so a non-FreeBSD target cannot be packaged
as an x86_64 FreeBSD archive.

Resolve cargo's host-tuple alias to the real host triple before choosing the
binary dir, so the path matches cargo's output.

* Skip the photocraft-cli --version run when CARGO_BUILD_TARGET is set

A target build's binary may not run on the host (aarch64 on the x86_64 VM),
and under set -e the smoke run would fail the release after the archive is
written. The native path (CARGO_BUILD_TARGET unset) still runs it.
2026-10-28 15:48:48 -04:00
..