From 2dbd793878a977491207b7dd73d962c2be60de78 Mon Sep 17 00:00:00 2001 From: Mike Phipps <15438609-k8wu@users.noreply.gitlab.com> Date: Sun, 1 Oct 2023 15:57:58 -0400 Subject: [PATCH] The wasm_build.sh script is now more resilient to failures in finding llvm-dwarfdump --- veilid-wasm/wasm_build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/veilid-wasm/wasm_build.sh b/veilid-wasm/wasm_build.sh index 5cf70dc6..7d16dd4a 100755 --- a/veilid-wasm/wasm_build.sh +++ b/veilid-wasm/wasm_build.sh @@ -14,14 +14,14 @@ if [ -f /usr/local/opt/llvm/bin/llvm-dwarfdump ]; then DWARFDUMP=/usr/local/opt/llvm/bin/llvm-dwarfdump elif [ -f /opt/homebrew/llvm/bin/llvm-dwarfdump ]; then DWARFDUMP=/opt/homebrew/llvm/bin/llvm-dwarfdump -else - DWARFDUMP=`which llvm-dwarfdump` +else + # some systems may have the major LLVM version suffixed on the LLVM binaries - and we need `true` at the end because the whole script will fail with a nonzero return if something goes wrong here + DWARFDUMP=`which llvm-dwarfdump || find ${PATH//:/\/ } -name 'llvm-dwarfdump*' 2>/dev/null | head -n1 || true` if [[ "${DWARFDUMP}" == "" ]]; then - echo llvm-dwarfdump not found + echo "llvm-dwarfdump not found" fi fi - if [[ "$1" == "release" ]]; then OUTPUTDIR=../target/wasm32-unknown-unknown/release/pkg INPUTDIR=../target/wasm32-unknown-unknown/release