From 0d49eddf16e55cbbc5d106458584fa5f81b43eed Mon Sep 17 00:00:00 2001 From: "Stephan Guilloux (cos)" Date: Sun, 2 Oct 2022 02:27:12 +0200 Subject: [PATCH] Problem: Android build script may fail silently Solution: Use `set -e` Note: To be reported in ZPROJECT, when generating the same for CZMQ & ZYRE. Note: `make clean` may fail when Makefile is not yet generated (case of 1st call of build.sh after git clone). Additionnaly, cleaned the dependency folder (report of ZPROJECT generated scripts). --- builds/android/build.sh | 4 +++- builds/android/ci_build.sh | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/builds/android/build.sh b/builds/android/build.sh index 3c7c8711..b35be86a 100755 --- a/builds/android/build.sh +++ b/builds/android/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + function usage { echo "Usage ./build.sh [ arm | arm64 | x86 | x86_64 ]" } @@ -86,7 +88,7 @@ LIBTOOL_EXTRA_LDFLAGS='-avoid-version' (android_build_verify_so ${VERIFY} &> /dev/null) || { rm -rf "${cache}/libzmq" - (cp -r ../.. "${cache}/libzmq" && cd "${cache}/libzmq" && make clean) + (cp -r ../.. "${cache}/libzmq" && cd "${cache}/libzmq" && ( make clean || : )) (cd "${cache}/libzmq" && ./autogen.sh \ && ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" ${CURVE} --without-docs \ diff --git a/builds/android/ci_build.sh b/builds/android/ci_build.sh index 8769dacf..14c11b81 100755 --- a/builds/android/ci_build.sh +++ b/builds/android/ci_build.sh @@ -1,8 +1,15 @@ #!/usr/bin/env bash +# +# Exit if any step fails +set -e export NDK_VERSION=android-ndk-r25 export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}" +# Cleanup. +rm -rf /tmp/tmp-deps +mkdir -p /tmp/tmp-deps + case $(uname | tr '[:upper:]' '[:lower:]') in linux*) HOST_PLATFORM=linux