From d73ccda13df32d54985902c0103bf787a10e3fd0 Mon Sep 17 00:00:00 2001 From: sanil-23 Date: Thu, 2 Apr 2026 20:20:15 +0530 Subject: [PATCH] fix: patch whisper-rs-sys for Windows MSVC static CRT (/MT) (#276) The upstream whisper-rs-sys builds whisper.cpp via CMake which defaults to /MD (dynamic CRT), but Rust and all other C deps use /MT (static CRT). This causes LNK2038/LNK1169 linker errors on Windows. Patch whisper-rs-sys from tinyhumansai/whisper-rs-sys fork which adds config.static_crt(true) and overrides all per-config CMake flags (Debug/Release/MinSizeRel/RelWithDebInfo) from /MD to /MT. Closes #273 --- Cargo.lock | 3 +-- Cargo.toml | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c30638a9..b3b0a954a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8600,8 +8600,7 @@ dependencies = [ [[package]] name = "whisper-rs-sys" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6986c0fe081241d391f09b9a071fbcbb59720c3563628c3c829057cf69f2a56f" +source = "git+https://github.com/tinyhumansai/whisper-rs-sys.git?branch=main#229cb4c97e41ca302d3f13b1fa7e93a9b417a5f9" dependencies = [ "bindgen", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index cd83d96ce..cef04ee8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,6 +123,13 @@ probe = ["dep:probe-rs"] rag-pdf = ["dep:pdf-extract"] whatsapp-web = ["dep:wa-rs", "dep:wa-rs-core", "dep:wa-rs-binary", "dep:wa-rs-proto", "dep:wa-rs-ureq-http", "dep:wa-rs-tokio-transport", "serde-big-array"] +# Fix whisper-rs-sys CRT mismatch on Windows MSVC (LNK2038). +# Upstream cmake build defaults to /MD but Rust uses /MT. +# This fork adds config.static_crt(true) to the build script. +# See: https://github.com/tinyhumansai/openhuman/issues/273 +[patch.crates-io] +whisper-rs-sys = { git = "https://github.com/tinyhumansai/whisper-rs-sys.git", branch = "main" } + # Fast CI builds: trade runtime perf for compile speed [profile.ci] inherits = "release"