From 8299c6b40a54c5b86e6a7f6a4af9496a6f27f642 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Fri, 30 Aug 2024 13:58:26 +0100 Subject: [PATCH] Allow openocd build to fail --- build_linux.sh | 17 +++++++---------- build_macos.sh | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/build_linux.sh b/build_linux.sh index 3331f2a..d829863 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -4,13 +4,7 @@ set -euo pipefail # Defaults SKIP_RISCV=${SKIP_RISCV-0} -if git clone https://git.savannah.nongnu.org/git/git2cl.git; then - SKIP_OPENOCD=${SKIP_OPENOCD-0} -else - # Clone is failing, so skip build - echo "Skipping openocd build, as likely to fail" - SKIP_OPENOCD=${SKIP_OPENOCD-1} -fi +SKIP_OPENOCD=${SKIP_OPENOCD-0} # Install prerequisites sudo apt install -y jq cmake libtool automake libusb-1.0-0-dev libhidapi-dev libftdi1-dev @@ -42,13 +36,16 @@ done < <(echo "$repos") cd $builddir +if [[ "$SKIP_OPENOCD" != 1 ]]; then + if ../packages/linux/openocd/build-openocd.sh; then + echo "OpenOCD Build failed" + SKIP_OPENOCD=1 + fi +fi if [[ "$SKIP_RISCV" != 1 ]]; then # Takes ages to build ../packages/linux/riscv/build-riscv-gcc.sh fi -if [[ "$SKIP_OPENOCD" != 1 ]]; then - ../packages/linux/openocd/build-openocd.sh -fi ../packages/linux/picotool/build-picotool.sh cd .. diff --git a/build_macos.sh b/build_macos.sh index 5823a66..33ab7df 100755 --- a/build_macos.sh +++ b/build_macos.sh @@ -4,13 +4,7 @@ set -euo pipefail # Defaults SKIP_RISCV=${SKIP_RISCV-0} -if git clone https://git.savannah.nongnu.org/git/git2cl.git; then - SKIP_OPENOCD=${SKIP_OPENOCD-0} -else - # Clone is failing, so skip build - echo "Skipping openocd build, as likely to fail" - SKIP_OPENOCD=${SKIP_OPENOCD-1} -fi +SKIP_OPENOCD=${SKIP_OPENOCD-0} # Install prerequisites arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi @@ -53,13 +47,16 @@ done < <(echo "$repos") cd $builddir +if [[ "$SKIP_OPENOCD" != 1 ]] && [[ $(uname -m) == 'arm64' ]]; then + if ../packages/macos/openocd/build-openocd.sh; then + echo "OpenOCD Build failed" + SKIP_OPENOCD=1 + fi +fi if [[ "$SKIP_RISCV" != 1 ]]; then # Takes ages to build ../packages/macos/riscv/build-riscv-gcc.sh fi -if [[ "$SKIP_OPENOCD" != 1 ]] && [[ $(uname -m) == 'arm64' ]]; then - ../packages/macos/openocd/build-openocd.sh -fi arch -x86_64 ../packages/macos/picotool/build-picotool.sh arch -arm64 ../packages/macos/picotool/build-picotool.sh ../packages/macos/picotool/merge-picotool.sh