fix: patch whisper-rs-sys for Windows MSVC static CRT#276
fix: patch whisper-rs-sys for Windows MSVC static CRT#276graycyrus merged 1 commit intotinyhumansai:mainfrom
Conversation
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 tinyhumansai#273
📝 WalkthroughWalkthroughThe pull request adds a Cargo patch override that redirects the Changes
Possibly related issues
Poem
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Cargo.toml`:
- Around line 130-131: The patch entry for whisper-rs-sys is using a floating
branch; replace the branch reference with the immutable commit currently in the
lockfile by changing the dependency spec for whisper-rs-sys to use rev =
"229cb4c97e41ca302d3f13b1fa7e93a9b417a5f9" (i.e., whisper-rs-sys = { git =
"https://github.com/tinyhumansai/whisper-rs-sys.git", rev =
"229cb4c97e41ca302d3f13b1fa7e93a9b417a5f9" }) so CI runs that don’t use --locked
cannot refresh to a different commit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fda8f977-f1ae-4ff1-a7b6-456b1b5ed80c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
Cargo.toml
Summary
whisper-rs-sysfrom tinyhumansai/whisper-rs-sys fork to fix Windows MSVC build failureProblem
whisper-rs-sysbuildswhisper.cppvia CMake which defaults to/MD(dynamic CRT)/MT(static CRT) on Windows MSVCLNK2038: mismatch detected for 'RuntimeLibrary'andLNK1169: multiply defined symbolsmainSolution
whisper-rs-systotinyhumansai/whisper-rs-syswith one change: callconfig.static_crt(true)inbuild.rsand override all per-config CMake flags (Debug/Release/MinSizeRel/RelWithDebInfo) from/MDto/MT[patch.crates-io]inCargo.tomlpointing to the forkSubmission Checklist
cargo build --bin openhuman-coresucceeds on Windows MSVC where it previously failedImpact
/MTinstead of/MDstatic_crtcall is gated behind#[cfg(target_env = "msvc")]Related
whisper-rscrateSummary by CodeRabbit