Make build auto-setup cross

This commit is contained in:
asonix 2020-04-18 14:51:16 -05:00
parent dd2658be82
commit 9e31fa5d3f

View file

@ -25,16 +25,17 @@ function print_help() {
require "$VERSION" "version" require "$VERSION" "version"
if docker run --rm -it arm64v8/ubuntu:19.10 /bin/bash -c 'echo "docker is configured correctly"'; then if ! docker run --rm -it arm64v8/ubuntu:19.10 /bin/bash -c 'echo "docker is configured correctly"'; then
echo ""
else
echo "docker is not configured to run on qemu-emulated architectures, fixing will require sudo" echo "docker is not configured to run on qemu-emulated architectures, fixing will require sudo"
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
fi fi
if ! which cross; then
cargo intall cross
fi
set -xe set -xe
# from `cargo install cross`
cross build \ cross build \
--target aarch64-unknown-linux-musl \ --target aarch64-unknown-linux-musl \
--release --release
@ -43,7 +44,6 @@ mkdir -p artifacts
rm -rf artifacts/relay rm -rf artifacts/relay
cp ./target/aarch64-unknown-linux-musl/release/relay artifacts/relay cp ./target/aarch64-unknown-linux-musl/release/relay artifacts/relay
# from `sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes`
docker build \ docker build \
--pull \ --pull \
--no-cache \ --no-cache \