packpack: Pass platform to docker if cross-compiling

pull/3900/head
Aaron Kling 2024-03-25 15:04:20 -05:00
parent 57e0c6a595
commit 2da562dad0
1 changed files with 12 additions and 0 deletions

View File

@ -263,6 +263,18 @@ execpackpack () {
parms=""
fi
HOST_ARCH="$(uname -m)"
if [ "${ARCH}" != "${HOST_ARCH}" ] && [ "${HOST_ARCH}" == "x86_64" ]; then
case "${ARCH}" in
"armhf")
export PACKPACK_EXTRA_DOCKER_RUN_PARAMS="--platform=linux/arm"
;;
"aarch64")
export PACKPACK_EXTRA_DOCKER_RUN_PARAMS="--platform=linux/arm64"
;;
esac
fi
if [ "${TRAVIS}" == "true" ]; then
# Travis will fail the build if the output gets too long
# To mitigate that, use grep to filter out some of the noise