From d11b202dd2c7e26fc850aa13388bd58862d021d3 Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Sat, 27 Jun 2026 14:07:56 +0200 Subject: [PATCH] fix(backends): whisper darwin run.sh loads whichever fallback lib exists (.so/.dylib) (#10553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(backends): whisper darwin run.sh loads whichever fallback lib exists The macOS branch hardcoded WHISPER_LIBRARY=$CURDIR/libgowhisper-fallback.dylib, but the cmake build emits a Mach-O named libgowhisper-fallback.so on darwin, so the Go loader panicked at runtime ("dlopen ...dylib: no such file") and the backend exited ("grpc service not ready") — breaking e.g. the silero-vad-ggml VAD on darwin. Pick whichever of .dylib/.so is present so it is robust to the build's naming either way. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- backend/go/whisper/run.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/go/whisper/run.sh b/backend/go/whisper/run.sh index 444a247c7..0cb05fe8b 100755 --- a/backend/go/whisper/run.sh +++ b/backend/go/whisper/run.sh @@ -13,8 +13,14 @@ if [ "$(uname)" != "Darwin" ]; then fi if [ "$(uname)" = "Darwin" ]; then - # macOS: single dylib variant (Metal or Accelerate) - LIBRARY="$CURDIR/libgowhisper-fallback.dylib" + # macOS: single fallback variant (Metal/Accelerate). The cmake build emits a + # Mach-O named .so, but tolerate .dylib too — pick whichever exists so the Go + # loader doesn't panic on a hardcoded name that isn't on disk. + if [ -e "$CURDIR/libgowhisper-fallback.dylib" ]; then + LIBRARY="$CURDIR/libgowhisper-fallback.dylib" + else + LIBRARY="$CURDIR/libgowhisper-fallback.so" + fi export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH else LIBRARY="$CURDIR/libgowhisper-fallback.so"