From 11a096e967762ea255a72d98287ff8d6803f0570 Mon Sep 17 00:00:00 2001 From: Tim Quelch Date: Fri, 14 Nov 2025 23:38:18 +1100 Subject: [PATCH] whisper-cpp: Ensure that backend dir is set If this field is not set, then the backend search path consists of the executable directory, and the current working directory. This works fine for executables that are bundled with whisper-cpp, but fails for anything that links against the library, e.g. ffmpeg. If there are no backends available other than CPU, this causes a crash. Implementation of the search path behaviour is here https://github.com/ggml-org/whisper.cpp/blob/d9b7613b34a343848af572cc14467fc5e82fc788/ggml/src/ggml-backend-reg.cpp#L522-L531 --- pkgs/by-name/wh/whisper-cpp/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/wh/whisper-cpp/package.nix b/pkgs/by-name/wh/whisper-cpp/package.nix index e54b0c4f5bd8..b6634206a748 100644 --- a/pkgs/by-name/wh/whisper-cpp/package.nix +++ b/pkgs/by-name/wh/whisper-cpp/package.nix @@ -125,6 +125,7 @@ effectiveStdenv.mkDerivation (finalAttrs: { ++ optionals (effectiveStdenv.hostPlatform.isx86 && !effectiveStdenv.hostPlatform.isStatic) [ (cmakeBool "GGML_BACKEND_DL" true) (cmakeBool "GGML_CPU_ALL_VARIANTS" true) + (cmakeFeature "GGML_BACKEND_DIR" "${placeholder "out"}/lib") ] ++ optionals cudaSupport [ (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)