diff options
author | Rina Fujino <18257209+rina23q@users.noreply.github.com> | 2022-06-29 16:51:09 +0200 |
---|---|---|
committer | Rina Fujino <18257209+rina23q@users.noreply.github.com> | 2022-06-29 16:51:09 +0200 |
commit | 2b4413f38e1f715879fe632175f5e3daf49ff0c1 (patch) | |
tree | a31958b9683129f12d394e4ffe2d6e64be3bef0a /ci/build_scripts/build_for_arm.sh | |
parent | 1bc7890ff319bbeb17abb145f4e3eeedaffd7262 (diff) |
Port build test step to bash script for arm
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
Diffstat (limited to 'ci/build_scripts/build_for_arm.sh')
-rwxr-xr-x | ci/build_scripts/build_for_arm.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ci/build_scripts/build_for_arm.sh b/ci/build_scripts/build_for_arm.sh new file mode 100755 index 00000000..c43e0d7b --- /dev/null +++ b/ci/build_scripts/build_for_arm.sh @@ -0,0 +1,34 @@ +#!/bin/bash -x + +set -euo pipefail + +ARCH=$1 + +# Install required cargo crates +cargo install cargo-deb --version 1.38.1 +cargo install cross + +# armv7 uses `arm-linux-gnueabihf-strip`; aarch64 uses `aarch64-linux-gnu-strip` +# It appears `aarch64-linux-gnu-strip` seems to work explicitly on other arm bins but not other way around. +sudo apt update +sudo apt-get --assume-yes install binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu + +# Load the release package list as $RELEASE_PACKAGES and $TEST_PACKAGES +source ./ci/package_list.sh + +# Cross build release for target +cross build --release --target="$ARCH" + +# Strip and create debian packages for release artifacts +for PACKAGE in "${RELEASE_PACKAGES[@]}" +do + arm-linux-gnueabihf-strip target/"$ARCH"/release/"$PACKAGE" || aarch64-linux-gnu-strip target/"$ARCH"/release/"$PACKAGE" + cargo deb -p "$PACKAGE" --no-strip --no-build --target="$ARCH" +done + +# Strip and build for test artifacts +for PACKAGE in "${TEST_PACKAGES[@]}" +do + cross build --release -p "$PACKAGE" --target="$ARCH" + arm-linux-gnueabihf-strip target/"$ARCH"/release/"$PACKAGE" || aarch64-linux-gnu-strip target/"$ARCH"/release/"$PACKAGE" +done |