From 74f07ecc35106d2ea7032816045fe6c8388ec0f3 Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Fri, 26 Jun 2026 01:02:48 +0200 Subject: [PATCH] fix(backends): quote $CURDIR in run.sh (fixes backends in paths with spaces) (#10519) fix(backends): quote $CURDIR in run.sh so backends work in paths with spaces The backend launcher scripts derive their own directory with CURDIR=$(dirname "$(realpath $0)") and then referenced it unquoted as $CURDIR (e.g. [ -f $CURDIR/lib/ld.so ], export LD_LIBRARY_PATH=$CURDIR/lib:..., exec $CURDIR/ "$@"). When a backend is installed under a path that contains a space - notably macOS's ~/Library/Application Support/... - bash word-splits the unquoted $CURDIR, so the test builtin fails with "binary operator expected" and exec tries to run ".../Library/Application", yielding "No such file or directory". The backend never starts, surfacing as a gRPC "service not ready" error and an HTTP 500. Quote $CURDIR (and the realpath "$0") in every affected run.sh; no logic changes. Co-authored-by: Ettore Di Giacinto Co-authored-by: Claude Opus 4.8 (1M context) --- backend/cpp/ik-llama-cpp/run.sh | 18 +++++++++--------- backend/cpp/llama-cpp/run.sh | 22 +++++++++++----------- backend/cpp/turboquant/run.sh | 20 ++++++++++---------- backend/go/acestep-cpp/run.sh | 18 +++++++++--------- backend/go/ced/run.sh | 4 ++-- backend/go/cloud-proxy/run.sh | 4 ++-- backend/go/crispasr/run.sh | 20 ++++++++++---------- backend/go/depth-anything-cpp/run.sh | 18 +++++++++--------- backend/go/local-store/run.sh | 4 ++-- backend/go/localvqe/run.sh | 20 ++++++++++---------- backend/go/locate-anything-cpp/run.sh | 18 +++++++++--------- backend/go/omnivoice-cpp/run.sh | 18 +++++++++--------- backend/go/opus/run.sh | 12 ++++++------ backend/go/parakeet-cpp/run.sh | 4 ++-- backend/go/piper/run.sh | 12 ++++++------ backend/go/qwen3-tts-cpp/run.sh | 18 +++++++++--------- backend/go/rfdetr-cpp/run.sh | 18 +++++++++--------- backend/go/sam3-cpp/run.sh | 18 +++++++++--------- backend/go/sherpa-onnx/run.sh | 16 ++++++++-------- backend/go/silero-vad/run.sh | 10 +++++----- backend/go/stablediffusion-ggml/run.sh | 18 +++++++++--------- backend/go/supertonic/run.sh | 16 ++++++++-------- backend/go/vibevoice-cpp/run.sh | 18 +++++++++--------- backend/go/voxtral/run.sh | 16 ++++++++-------- backend/go/whisper/run.sh | 18 +++++++++--------- backend/rust/kokoros/run.sh | 14 +++++++------- 26 files changed, 196 insertions(+), 196 deletions(-) diff --git a/backend/cpp/ik-llama-cpp/run.sh b/backend/cpp/ik-llama-cpp/run.sh index 1c4ee2a69..d10d19367 100644 --- a/backend/cpp/ik-llama-cpp/run.sh +++ b/backend/cpp/ik-llama-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -13,28 +13,28 @@ grep -e "flags" /proc/cpuinfo | head -1 # ik_llama.cpp requires AVX2 — default to avx2 binary BINARY=ik-llama-cpp-avx2 -if [ -e $CURDIR/ik-llama-cpp-fallback ] && ! grep -q -e "\savx2\s" /proc/cpuinfo ; then +if [ -e "$CURDIR"/ik-llama-cpp-fallback ] && ! grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 NOT found, using fallback" BINARY=ik-llama-cpp-fallback fi # Extend ld library path with the dir where this script is located/lib if [ "$(uname)" == "Darwin" ]; then - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH - #export DYLD_FALLBACK_LIBRARY_PATH=$CURDIR/lib:$DYLD_FALLBACK_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH + #export DYLD_FALLBACK_LIBRARY_PATH="$CURDIR"/lib:$DYLD_FALLBACK_LIBRARY_PATH else - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using binary: $BINARY" - exec $CURDIR/lib/ld.so $CURDIR/$BINARY "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/$BINARY "$@" fi echo "Using binary: $BINARY" -exec $CURDIR/$BINARY "$@" +exec "$CURDIR"/$BINARY "$@" # We should never reach this point, however just in case we do, run fallback -exec $CURDIR/ik-llama-cpp-fallback "$@" +exec "$CURDIR"/ik-llama-cpp-fallback "$@" diff --git a/backend/cpp/llama-cpp/run.sh b/backend/cpp/llama-cpp/run.sh index db8498f4b..09a13b0fe 100755 --- a/backend/cpp/llama-cpp/run.sh +++ b/backend/cpp/llama-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -16,37 +16,37 @@ BINARY=llama-cpp-fallback # CPU_ALL_VARIANTS: ggml's backend registry dlopens the best libggml-cpu-*.so for this # host, so no shell-side AVX probing. GPU images (cublas/sycl/vulkan/hipblas) ship only # llama-cpp-fallback (the accelerator does the compute), so fall back to it when absent. -if [ -e $CURDIR/llama-cpp-cpu-all ]; then +if [ -e "$CURDIR"/llama-cpp-cpu-all ]; then BINARY=llama-cpp-cpu-all fi if [ -n "$LLAMACPP_GRPC_SERVERS" ]; then - if [ -e $CURDIR/llama-cpp-grpc ]; then + if [ -e "$CURDIR"/llama-cpp-grpc ]; then BINARY=llama-cpp-grpc fi fi # Extend ld library path with the dir where this script is located/lib if [ "$(uname)" == "Darwin" ]; then - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH - #export DYLD_FALLBACK_LIBRARY_PATH=$CURDIR/lib:$DYLD_FALLBACK_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH + #export DYLD_FALLBACK_LIBRARY_PATH="$CURDIR"/lib:$DYLD_FALLBACK_LIBRARY_PATH else - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH # Tell rocBLAS where to find TensileLibrary data (GPU kernel tuning files) if [ -d "$CURDIR/lib/rocblas/library" ]; then - export ROCBLAS_TENSILE_LIBPATH=$CURDIR/lib/rocblas/library + export ROCBLAS_TENSILE_LIBPATH="$CURDIR"/lib/rocblas/library fi fi # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using binary: $BINARY" - exec $CURDIR/lib/ld.so $CURDIR/$BINARY "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/$BINARY "$@" fi echo "Using binary: $BINARY" -exec $CURDIR/$BINARY "$@" +exec "$CURDIR"/$BINARY "$@" # We should never reach this point, however just in case we do, run fallback -exec $CURDIR/llama-cpp-fallback "$@" \ No newline at end of file +exec "$CURDIR"/llama-cpp-fallback "$@" \ No newline at end of file diff --git a/backend/cpp/turboquant/run.sh b/backend/cpp/turboquant/run.sh index cd41a0f7f..33864385d 100755 --- a/backend/cpp/turboquant/run.sh +++ b/backend/cpp/turboquant/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,36 +15,36 @@ BINARY=turboquant-fallback # x86/arm64 ship a single turboquant-cpu-all built with ggml CPU_ALL_VARIANTS: ggml's # backend registry dlopens the best libggml-cpu-*.so for this host, so no shell-side # probing. ROCm ships only turboquant-fallback, so fall back to it when cpu-all is absent. -if [ -e $CURDIR/turboquant-cpu-all ]; then +if [ -e "$CURDIR"/turboquant-cpu-all ]; then BINARY=turboquant-cpu-all fi if [ -n "$LLAMACPP_GRPC_SERVERS" ]; then - if [ -e $CURDIR/turboquant-grpc ]; then + if [ -e "$CURDIR"/turboquant-grpc ]; then BINARY=turboquant-grpc fi fi # Extend ld library path with the dir where this script is located/lib if [ "$(uname)" == "Darwin" ]; then - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH # Tell rocBLAS where to find TensileLibrary data (GPU kernel tuning files) if [ -d "$CURDIR/lib/rocblas/library" ]; then - export ROCBLAS_TENSILE_LIBPATH=$CURDIR/lib/rocblas/library + export ROCBLAS_TENSILE_LIBPATH="$CURDIR"/lib/rocblas/library fi fi # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using binary: $BINARY" - exec $CURDIR/lib/ld.so $CURDIR/$BINARY "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/$BINARY "$@" fi echo "Using binary: $BINARY" -exec $CURDIR/$BINARY "$@" +exec "$CURDIR"/$BINARY "$@" # We should never reach this point, however just in case we do, run fallback -exec $CURDIR/turboquant-fallback "$@" +exec "$CURDIR"/turboquant-fallback "$@" diff --git a/backend/go/acestep-cpp/run.sh b/backend/go/acestep-cpp/run.sh index bcdfbc09e..c026e2051 100755 --- a/backend/go/acestep-cpp/run.sh +++ b/backend/go/acestep-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -21,20 +21,20 @@ if [ "$(uname)" = "Darwin" ]; then if [ ! -e "$LIBRARY" ]; then LIBRARY="$CURDIR/libgoacestepcpp-fallback.so" fi - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgoacestepcpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgoacestepcpp-avx.so ]; then + if [ -e "$CURDIR"/libgoacestepcpp-avx.so ]; then LIBRARY="$CURDIR/libgoacestepcpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgoacestepcpp-avx2.so ]; then + if [ -e "$CURDIR"/libgoacestepcpp-avx2.so ]; then LIBRARY="$CURDIR/libgoacestepcpp-avx2.so" fi fi @@ -42,22 +42,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgoacestepcpp-avx512.so ]; then + if [ -e "$CURDIR"/libgoacestepcpp-avx512.so ]; then LIBRARY="$CURDIR/libgoacestepcpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export ACESTEP_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/acestep-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/acestep-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/acestep-cpp "$@" +exec "$CURDIR"/acestep-cpp "$@" diff --git a/backend/go/ced/run.sh b/backend/go/ced/run.sh index 1f95f748f..5375af4ef 100755 --- a/backend/go/ced/run.sh +++ b/backend/go/ced/run.sh @@ -4,10 +4,10 @@ set -e CURDIR=$(dirname "$(realpath "$0")") if [ "$(uname)" = "Darwin" ]; then - export DYLD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${DYLD_LIBRARY_PATH:-}" + export DYLD_LIBRARY_PATH="$CURDIR/lib:"$CURDIR":${DYLD_LIBRARY_PATH:-}" export CED_LIBRARY="$CURDIR/lib/libced.dylib" else - export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}" + export LD_LIBRARY_PATH="$CURDIR/lib:"$CURDIR":${LD_LIBRARY_PATH:-}" fi # If a self-contained ld.so was packaged, route through it so the packaged diff --git a/backend/go/cloud-proxy/run.sh b/backend/go/cloud-proxy/run.sh index c533c093a..efef811de 100755 --- a/backend/go/cloud-proxy/run.sh +++ b/backend/go/cloud-proxy/run.sh @@ -1,6 +1,6 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -exec $CURDIR/cloud-proxy "$@" +exec "$CURDIR"/cloud-proxy "$@" diff --git a/backend/go/crispasr/run.sh b/backend/go/crispasr/run.sh index 6d3c4b216..078e0659f 100755 --- a/backend/go/crispasr/run.sh +++ b/backend/go/crispasr/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgocrispasr-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgocrispasr-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgocrispasr-avx.so ]; then + if [ -e "$CURDIR"/libgocrispasr-avx.so ]; then LIBRARY="$CURDIR/libgocrispasr-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgocrispasr-avx2.so ]; then + if [ -e "$CURDIR"/libgocrispasr-avx2.so ]; then LIBRARY="$CURDIR/libgocrispasr-avx2.so" fi fi @@ -36,12 +36,12 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgocrispasr-avx512.so ]; then + if [ -e "$CURDIR"/libgocrispasr-avx512.so ]; then LIBRARY="$CURDIR/libgocrispasr-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export CRISPASR_LIBRARY=$LIBRARY @@ -49,14 +49,14 @@ export CRISPASR_LIBRARY=$LIBRARY # Point piper's espeak-ng phonemizer at the bundled voice data. The variable # names the directory CONTAINING espeak-ng-data (package.sh drops it next to # this script). Harmless when espeak-ng wasn't bundled. -export CRISPASR_ESPEAK_DATA_PATH=$CURDIR +export CRISPASR_ESPEAK_DATA_PATH="$CURDIR" # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/crispasr "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/crispasr "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/crispasr "$@" +exec "$CURDIR"/crispasr "$@" diff --git a/backend/go/depth-anything-cpp/run.sh b/backend/go/depth-anything-cpp/run.sh index cbff6b0b5..8729389b4 100755 --- a/backend/go/depth-anything-cpp/run.sh +++ b/backend/go/depth-anything-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libdepthanythingcpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libdepthanythingcpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libdepthanythingcpp-avx.so ]; then + if [ -e "$CURDIR"/libdepthanythingcpp-avx.so ]; then LIBRARY="$CURDIR/libdepthanythingcpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libdepthanythingcpp-avx2.so ]; then + if [ -e "$CURDIR"/libdepthanythingcpp-avx2.so ]; then LIBRARY="$CURDIR/libdepthanythingcpp-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libdepthanythingcpp-avx512.so ]; then + if [ -e "$CURDIR"/libdepthanythingcpp-avx512.so ]; then LIBRARY="$CURDIR/libdepthanythingcpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export DEPTHANYTHING_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/depth-anything-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/depth-anything-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/depth-anything-cpp "$@" +exec "$CURDIR"/depth-anything-cpp "$@" diff --git a/backend/go/local-store/run.sh b/backend/go/local-store/run.sh index 479f3b486..ba0173401 100755 --- a/backend/go/local-store/run.sh +++ b/backend/go/local-store/run.sh @@ -1,6 +1,6 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -exec $CURDIR/local-store "$@" \ No newline at end of file +exec "$CURDIR"/local-store "$@" \ No newline at end of file diff --git a/backend/go/localvqe/run.sh b/backend/go/localvqe/run.sh index d14d427c4..542885572 100755 --- a/backend/go/localvqe/run.sh +++ b/backend/go/localvqe/run.sh @@ -1,34 +1,34 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") # LocalVQE's runtime CPU-variant loader (ggml_backend_load_all) searches # get_executable_path() and current_path() — the second one is what saves us # when /proc/self/exe resolves to lib/ld.so under the bundled-loader path. -# So we cd into $CURDIR (where all the libggml-cpu-*.so files live) before +# So we cd into "$CURDIR" (where all the libggml-cpu-*.so files live) before # exec'ing the binary. cd "$CURDIR" if [ "$(uname)" = "Darwin" ]; then # macOS: LocalVQE is built as a SHARED library, so dyld needs the .dylib + # DYLD_LIBRARY_PATH. Prefer .dylib and fall back to .so just in case. - export DYLD_LIBRARY_PATH=$CURDIR:$CURDIR/lib:$DYLD_LIBRARY_PATH - LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.dylib + export DYLD_LIBRARY_PATH="$CURDIR":"$CURDIR"/lib:$DYLD_LIBRARY_PATH + LOCALVQE_LIBRARY="$CURDIR"/liblocalvqe.dylib if [ ! -e "$LOCALVQE_LIBRARY" ]; then - LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.so + LOCALVQE_LIBRARY="$CURDIR"/liblocalvqe.so fi export LOCALVQE_LIBRARY else - export LD_LIBRARY_PATH=$CURDIR:$CURDIR/lib:$LD_LIBRARY_PATH - export LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.so + export LD_LIBRARY_PATH="$CURDIR":"$CURDIR"/lib:$LD_LIBRARY_PATH + export LOCALVQE_LIBRARY="$CURDIR"/liblocalvqe.so fi -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LOCALVQE_LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/localvqe "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/localvqe "$@" fi echo "Using library: $LOCALVQE_LIBRARY" -exec $CURDIR/localvqe "$@" +exec "$CURDIR"/localvqe "$@" diff --git a/backend/go/locate-anything-cpp/run.sh b/backend/go/locate-anything-cpp/run.sh index 4eebb3c63..3a6ccf259 100755 --- a/backend/go/locate-anything-cpp/run.sh +++ b/backend/go/locate-anything-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/liblocateanythingcpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/liblocateanythingcpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/liblocateanythingcpp-avx.so ]; then + if [ -e "$CURDIR"/liblocateanythingcpp-avx.so ]; then LIBRARY="$CURDIR/liblocateanythingcpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/liblocateanythingcpp-avx2.so ]; then + if [ -e "$CURDIR"/liblocateanythingcpp-avx2.so ]; then LIBRARY="$CURDIR/liblocateanythingcpp-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/liblocateanythingcpp-avx512.so ]; then + if [ -e "$CURDIR"/liblocateanythingcpp-avx512.so ]; then LIBRARY="$CURDIR/liblocateanythingcpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export LOCATEANYTHING_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/locate-anything-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/locate-anything-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/locate-anything-cpp "$@" +exec "$CURDIR"/locate-anything-cpp "$@" diff --git a/backend/go/omnivoice-cpp/run.sh b/backend/go/omnivoice-cpp/run.sh index 81ea2b719..706f80dd6 100755 --- a/backend/go/omnivoice-cpp/run.sh +++ b/backend/go/omnivoice-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgomnivoicecpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgomnivoicecpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgomnivoicecpp-avx.so ]; then + if [ -e "$CURDIR"/libgomnivoicecpp-avx.so ]; then LIBRARY="$CURDIR/libgomnivoicecpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgomnivoicecpp-avx2.so ]; then + if [ -e "$CURDIR"/libgomnivoicecpp-avx2.so ]; then LIBRARY="$CURDIR/libgomnivoicecpp-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgomnivoicecpp-avx512.so ]; then + if [ -e "$CURDIR"/libgomnivoicecpp-avx512.so ]; then LIBRARY="$CURDIR/libgomnivoicecpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export OMNIVOICE_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/omnivoice-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/omnivoice-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/omnivoice-cpp "$@" +exec "$CURDIR"/omnivoice-cpp "$@" diff --git a/backend/go/opus/run.sh b/backend/go/opus/run.sh index d926c57d0..1a54b0c40 100644 --- a/backend/go/opus/run.sh +++ b/backend/go/opus/run.sh @@ -1,15 +1,15 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH -export OPUS_SHIM_LIBRARY=$CURDIR/lib/libopusshim.so +export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH +export OPUS_SHIM_LIBRARY="$CURDIR"/lib/libopusshim.so # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" - exec $CURDIR/lib/ld.so $CURDIR/opus "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/opus "$@" fi -exec $CURDIR/opus "$@" +exec "$CURDIR"/opus "$@" diff --git a/backend/go/parakeet-cpp/run.sh b/backend/go/parakeet-cpp/run.sh index be859f381..5f99c5d24 100755 --- a/backend/go/parakeet-cpp/run.sh +++ b/backend/go/parakeet-cpp/run.sh @@ -4,10 +4,10 @@ set -e CURDIR=$(dirname "$(realpath "$0")") if [ "$(uname)" = "Darwin" ]; then - export DYLD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${DYLD_LIBRARY_PATH:-}" + export DYLD_LIBRARY_PATH="$CURDIR/lib:"$CURDIR":${DYLD_LIBRARY_PATH:-}" export PARAKEET_LIBRARY="$CURDIR/lib/libparakeet.dylib" else - export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}" + export LD_LIBRARY_PATH="$CURDIR/lib:"$CURDIR":${LD_LIBRARY_PATH:-}" export PARAKEET_LIBRARY="$CURDIR/lib/libparakeet.so" fi diff --git a/backend/go/piper/run.sh b/backend/go/piper/run.sh index fe120ea88..6e04021e3 100755 --- a/backend/go/piper/run.sh +++ b/backend/go/piper/run.sh @@ -1,15 +1,15 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -export ESPEAK_NG_DATA=$CURDIR/espeak-ng-data -export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH +export ESPEAK_NG_DATA="$CURDIR"/espeak-ng-data +export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" - exec $CURDIR/lib/ld.so $CURDIR/piper "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/piper "$@" fi -exec $CURDIR/piper "$@" \ No newline at end of file +exec "$CURDIR"/piper "$@" \ No newline at end of file diff --git a/backend/go/qwen3-tts-cpp/run.sh b/backend/go/qwen3-tts-cpp/run.sh index 638cf9661..2b8934d1b 100755 --- a/backend/go/qwen3-tts-cpp/run.sh +++ b/backend/go/qwen3-tts-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgoqwen3ttscpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgoqwen3ttscpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgoqwen3ttscpp-avx.so ]; then + if [ -e "$CURDIR"/libgoqwen3ttscpp-avx.so ]; then LIBRARY="$CURDIR/libgoqwen3ttscpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgoqwen3ttscpp-avx2.so ]; then + if [ -e "$CURDIR"/libgoqwen3ttscpp-avx2.so ]; then LIBRARY="$CURDIR/libgoqwen3ttscpp-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgoqwen3ttscpp-avx512.so ]; then + if [ -e "$CURDIR"/libgoqwen3ttscpp-avx512.so ]; then LIBRARY="$CURDIR/libgoqwen3ttscpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export QWEN3TTS_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/qwen3-tts-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/qwen3-tts-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/qwen3-tts-cpp "$@" +exec "$CURDIR"/qwen3-tts-cpp "$@" diff --git a/backend/go/rfdetr-cpp/run.sh b/backend/go/rfdetr-cpp/run.sh index ffbd604dd..0e7775cb7 100755 --- a/backend/go/rfdetr-cpp/run.sh +++ b/backend/go/rfdetr-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/librfdetrcpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/librfdetrcpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/librfdetrcpp-avx.so ]; then + if [ -e "$CURDIR"/librfdetrcpp-avx.so ]; then LIBRARY="$CURDIR/librfdetrcpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/librfdetrcpp-avx2.so ]; then + if [ -e "$CURDIR"/librfdetrcpp-avx2.so ]; then LIBRARY="$CURDIR/librfdetrcpp-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/librfdetrcpp-avx512.so ]; then + if [ -e "$CURDIR"/librfdetrcpp-avx512.so ]; then LIBRARY="$CURDIR/librfdetrcpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export RFDETR_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/rfdetr-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/rfdetr-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/rfdetr-cpp "$@" +exec "$CURDIR"/rfdetr-cpp "$@" diff --git a/backend/go/sam3-cpp/run.sh b/backend/go/sam3-cpp/run.sh index 7bff52df6..7794facde 100755 --- a/backend/go/sam3-cpp/run.sh +++ b/backend/go/sam3-cpp/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgosam3-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgosam3-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgosam3-avx.so ]; then + if [ -e "$CURDIR"/libgosam3-avx.so ]; then LIBRARY="$CURDIR/libgosam3-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgosam3-avx2.so ]; then + if [ -e "$CURDIR"/libgosam3-avx2.so ]; then LIBRARY="$CURDIR/libgosam3-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgosam3-avx512.so ]; then + if [ -e "$CURDIR"/libgosam3-avx512.so ]; then LIBRARY="$CURDIR/libgosam3-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export SAM3_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/sam3-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/sam3-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/sam3-cpp "$@" +exec "$CURDIR"/sam3-cpp "$@" diff --git a/backend/go/sherpa-onnx/run.sh b/backend/go/sherpa-onnx/run.sh index 771324326..e5e4a7c62 100755 --- a/backend/go/sherpa-onnx/run.sh +++ b/backend/go/sherpa-onnx/run.sh @@ -1,19 +1,19 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") if [ "$(uname)" = "Darwin" ]; then - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH - export SHERPA_SHIM_LIBRARY=$CURDIR/lib/libsherpa-shim.dylib - export SHERPA_ONNX_LIBRARY=$CURDIR/lib/libsherpa-onnx-c-api.dylib + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH + export SHERPA_SHIM_LIBRARY="$CURDIR"/lib/libsherpa-shim.dylib + export SHERPA_ONNX_LIBRARY="$CURDIR"/lib/libsherpa-onnx-c-api.dylib else - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" - exec $CURDIR/lib/ld.so $CURDIR/sherpa-onnx "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/sherpa-onnx "$@" fi -exec $CURDIR/sherpa-onnx "$@" +exec "$CURDIR"/sherpa-onnx "$@" diff --git a/backend/go/silero-vad/run.sh b/backend/go/silero-vad/run.sh index 72658908a..d8c343223 100755 --- a/backend/go/silero-vad/run.sh +++ b/backend/go/silero-vad/run.sh @@ -1,14 +1,14 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" - exec $CURDIR/lib/ld.so $CURDIR/silero-vad "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/silero-vad "$@" fi -exec $CURDIR/silero-vad "$@" \ No newline at end of file +exec "$CURDIR"/silero-vad "$@" \ No newline at end of file diff --git a/backend/go/stablediffusion-ggml/run.sh b/backend/go/stablediffusion-ggml/run.sh index e026b4b28..94d920490 100755 --- a/backend/go/stablediffusion-ggml/run.sh +++ b/backend/go/stablediffusion-ggml/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -20,20 +20,20 @@ if [ "$(uname)" = "Darwin" ]; then if [ ! -e "$LIBRARY" ]; then LIBRARY="$CURDIR/libgosd-fallback.so" fi - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgosd-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgosd-avx.so ]; then + if [ -e "$CURDIR"/libgosd-avx.so ]; then LIBRARY="$CURDIR/libgosd-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgosd-avx2.so ]; then + if [ -e "$CURDIR"/libgosd-avx2.so ]; then LIBRARY="$CURDIR/libgosd-avx2.so" fi fi @@ -41,22 +41,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgosd-avx512.so ]; then + if [ -e "$CURDIR"/libgosd-avx512.so ]; then LIBRARY="$CURDIR/libgosd-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export SD_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/stablediffusion-ggml "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/stablediffusion-ggml "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/stablediffusion-ggml "$@" +exec "$CURDIR"/stablediffusion-ggml "$@" diff --git a/backend/go/supertonic/run.sh b/backend/go/supertonic/run.sh index 683c52ab2..5d116e834 100755 --- a/backend/go/supertonic/run.sh +++ b/backend/go/supertonic/run.sh @@ -1,21 +1,21 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") if [ "$(uname)" = "Darwin" ]; then # macOS uses dyld: there is no ld.so loader, and the search path env # var is DYLD_LIBRARY_PATH. ONNX Runtime ships as a .dylib here. - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH - export ONNXRUNTIME_LIB_PATH=$CURDIR/lib/libonnxruntime.dylib + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH + export ONNXRUNTIME_LIB_PATH="$CURDIR"/lib/libonnxruntime.dylib else - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH - export ONNXRUNTIME_LIB_PATH=$CURDIR/lib/libonnxruntime.so + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH + export ONNXRUNTIME_LIB_PATH="$CURDIR"/lib/libonnxruntime.so - if [ -f $CURDIR/lib/ld.so ]; then + if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" - exec $CURDIR/lib/ld.so $CURDIR/supertonic "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/supertonic "$@" fi fi -exec $CURDIR/supertonic "$@" +exec "$CURDIR"/supertonic "$@" diff --git a/backend/go/vibevoice-cpp/run.sh b/backend/go/vibevoice-cpp/run.sh index ec5a39c14..6ce29cb44 100755 --- a/backend/go/vibevoice-cpp/run.sh +++ b/backend/go/vibevoice-cpp/run.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -14,41 +14,41 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgovibevoicecpp-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgovibevoicecpp-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgovibevoicecpp-avx.so ]; then + if [ -e "$CURDIR"/libgovibevoicecpp-avx.so ]; then LIBRARY="$CURDIR/libgovibevoicecpp-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgovibevoicecpp-avx2.so ]; then + if [ -e "$CURDIR"/libgovibevoicecpp-avx2.so ]; then LIBRARY="$CURDIR/libgovibevoicecpp-avx2.so" fi fi if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgovibevoicecpp-avx512.so ]; then + if [ -e "$CURDIR"/libgovibevoicecpp-avx512.so ]; then LIBRARY="$CURDIR/libgovibevoicecpp-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export VIBEVOICECPP_LIBRARY=$LIBRARY -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/vibevoice-cpp "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/vibevoice-cpp "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/vibevoice-cpp "$@" +exec "$CURDIR"/vibevoice-cpp "$@" diff --git a/backend/go/voxtral/run.sh b/backend/go/voxtral/run.sh index 748c30341..b8be0580d 100644 --- a/backend/go/voxtral/run.sh +++ b/backend/go/voxtral/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,35 +15,35 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgovoxtral-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgovoxtral-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgovoxtral-avx.so ]; then + if [ -e "$CURDIR"/libgovoxtral-avx.so ]; then LIBRARY="$CURDIR/libgovoxtral-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgovoxtral-avx2.so ]; then + if [ -e "$CURDIR"/libgovoxtral-avx2.so ]; then LIBRARY="$CURDIR/libgovoxtral-avx2.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export VOXTRAL_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it (Linux only) -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/voxtral "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/voxtral "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/voxtral "$@" +exec "$CURDIR"/voxtral "$@" diff --git a/backend/go/whisper/run.sh b/backend/go/whisper/run.sh index 0e2bd7eb0..444a247c7 100755 --- a/backend/go/whisper/run.sh +++ b/backend/go/whisper/run.sh @@ -2,7 +2,7 @@ set -ex # Get the absolute current dir where the script is located -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") cd / @@ -15,20 +15,20 @@ fi if [ "$(uname)" = "Darwin" ]; then # macOS: single dylib variant (Metal or Accelerate) LIBRARY="$CURDIR/libgowhisper-fallback.dylib" - export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgowhisper-fallback.so" if grep -q -e "\savx\s" /proc/cpuinfo ; then echo "CPU: AVX found OK" - if [ -e $CURDIR/libgowhisper-avx.so ]; then + if [ -e "$CURDIR"/libgowhisper-avx.so ]; then LIBRARY="$CURDIR/libgowhisper-avx.so" fi fi if grep -q -e "\savx2\s" /proc/cpuinfo ; then echo "CPU: AVX2 found OK" - if [ -e $CURDIR/libgowhisper-avx2.so ]; then + if [ -e "$CURDIR"/libgowhisper-avx2.so ]; then LIBRARY="$CURDIR/libgowhisper-avx2.so" fi fi @@ -36,22 +36,22 @@ else # Check avx 512 if grep -q -e "\savx512f\s" /proc/cpuinfo ; then echo "CPU: AVX512F found OK" - if [ -e $CURDIR/libgowhisper-avx512.so ]; then + if [ -e "$CURDIR"/libgowhisper-avx512.so ]; then LIBRARY="$CURDIR/libgowhisper-avx512.so" fi fi - export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH="$CURDIR"/lib:$LD_LIBRARY_PATH fi export WHISPER_LIBRARY=$LIBRARY # If there is a lib/ld.so, use it -if [ -f $CURDIR/lib/ld.so ]; then +if [ -f "$CURDIR"/lib/ld.so ]; then echo "Using lib/ld.so" echo "Using library: $LIBRARY" - exec $CURDIR/lib/ld.so $CURDIR/whisper "$@" + exec "$CURDIR"/lib/ld.so "$CURDIR"/whisper "$@" fi echo "Using library: $LIBRARY" -exec $CURDIR/whisper "$@" \ No newline at end of file +exec "$CURDIR"/whisper "$@" \ No newline at end of file diff --git a/backend/rust/kokoros/run.sh b/backend/rust/kokoros/run.sh index bdea9f77a..b2acfe184 100755 --- a/backend/rust/kokoros/run.sh +++ b/backend/rust/kokoros/run.sh @@ -1,23 +1,23 @@ #!/bin/bash set -ex -CURDIR=$(dirname "$(realpath $0)") +CURDIR=$(dirname "$(realpath "$0")") -export LD_LIBRARY_PATH=$CURDIR/lib:${LD_LIBRARY_PATH:-} +export LD_LIBRARY_PATH="$CURDIR"/lib:${LD_LIBRARY_PATH:-} # SSL certificates for model auto-download if [ -d "$CURDIR/etc/ssl/certs" ]; then - export SSL_CERT_DIR=$CURDIR/etc/ssl/certs + export SSL_CERT_DIR="$CURDIR"/etc/ssl/certs fi # espeak-ng data directory if [ -d "$CURDIR/espeak-ng-data" ]; then - export ESPEAK_NG_DATA=$CURDIR/espeak-ng-data + export ESPEAK_NG_DATA="$CURDIR"/espeak-ng-data fi # Use bundled ld.so if present (portability) -if [ -f $CURDIR/lib/ld.so ]; then - exec $CURDIR/lib/ld.so $CURDIR/kokoros-grpc "$@" +if [ -f "$CURDIR"/lib/ld.so ]; then + exec "$CURDIR"/lib/ld.so "$CURDIR"/kokoros-grpc "$@" fi -exec $CURDIR/kokoros-grpc "$@" +exec "$CURDIR"/kokoros-grpc "$@"