Skip to content

Commit d11b202

Browse files
localai-botmudler
andauthored
fix(backends): whisper darwin run.sh loads whichever fallback lib exists (.so/.dylib) (#10553)
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 <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent e95018e commit d11b202

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

backend/go/whisper/run.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ if [ "$(uname)" != "Darwin" ]; then
1313
fi
1414

1515
if [ "$(uname)" = "Darwin" ]; then
16-
# macOS: single dylib variant (Metal or Accelerate)
17-
LIBRARY="$CURDIR/libgowhisper-fallback.dylib"
16+
# macOS: single fallback variant (Metal/Accelerate). The cmake build emits a
17+
# Mach-O named .so, but tolerate .dylib too — pick whichever exists so the Go
18+
# loader doesn't panic on a hardcoded name that isn't on disk.
19+
if [ -e "$CURDIR/libgowhisper-fallback.dylib" ]; then
20+
LIBRARY="$CURDIR/libgowhisper-fallback.dylib"
21+
else
22+
LIBRARY="$CURDIR/libgowhisper-fallback.so"
23+
fi
1824
export DYLD_LIBRARY_PATH="$CURDIR"/lib:$DYLD_LIBRARY_PATH
1925
else
2026
LIBRARY="$CURDIR/libgowhisper-fallback.so"

0 commit comments

Comments
 (0)