macOS: engine-sherpa breaks pyannote-rs ORT initialization
Environment
- macOS Apple Silicon (
arm64) - Minutes
0.24.0@be2cad55 - Build: default features +
engine-sherpa,metal vad_engine = "whisper-silero"ORT_DYLIB_PATHunset- Homebrew
onnxruntimenot installed
Problem
Sherpa transcription works, but minutes enroll fails when pyannote-rs initializes:
running diarization engine=pyannote-rs
The requested API version [22] is not available,
only API versions [1, 17] are supported in this build.
Current ORT Version is: 1.17.1
Failed to initialize ORT API
A/B reproduction
With Sherpa:
cargo build --release -p minutes-cli \
--features "engine-sherpa,metal"
./target/release/minutes enroll
→ pyannote-rs fails with ORT API 17/22 mismatch.
Same commit, without Sherpa:
CARGO_TARGET_DIR=target-pyannote \
cargo build --release -p minutes-cli \
--features metal
target-pyannote/release/minutes enroll
→ succeeds:
Session successfully initialized.
speaker clustering complete
diarization complete
✓ Voice profile saved!
Sherpa transcription itself also works correctly in the first build.
This looks related to #408/#369, but this is not the ort-silero VAD path: vad_engine is whisper-silero; the failure occurs when pyannote-rs initializes.
Expected: engine-sherpa should coexist with the default diarize feature.
Thank you for this report. The A/B reproduction was exactly what made it fast to run down: I reproduced both sides verbatim on an arm64 iMac at the same commit, and your diagnosis of an ORT version fight was right, with one addition that changes the conclusion.
There are two collisions, not one. sherpa-onnx's static bundle carries ONNX Runtime 1.17.1 while pyannote's ort-sys is 1.22.0 (requesting API 22), which is the error you hit. But both stacks also vendor kaldi-native-fbank, down to the identical archive name. I tested every link resolution by substituting archives:
| ORT winner | kaldi winner | pyannote | sherpa |
|---|---|---|---|
| 1.17.1 | sherpa's | fails (your error) | works |
| 1.22.0 | sherpa's | SIGABRT in feature extraction | works |
| 1.22.0 | knf-rs's | works | SIGABRT |
ORT alone would have been fixable, since its C API is backward compatible and sherpa runs fine on 1.22.0. kaldi-native-fbank has no ABI contract, so no single-namespace link works, and the near-miss outcome is undefined behavior rather than a clean failure.
So the honest fix lands in two parts:
- #686 makes the combination refuse at compile time on macOS with the working invocation in the error message, instead of building a binary with a runtime landmine. For your use case today, the sherpa transcription build is
cargo build --release -p minutes-cli --no-default-features --features whisper,engine-sherpa,metal, and enrollment works in a default-features build, exactly as your target-pyannote build already does. - #685 tracks the real fix: isolating the sherpa stack behind its own namespace (a dlopen'd plugin using macOS two-level namespaces) so both engines can share one binary again.
For what it's worth, no shipped release carries the broken combination; your source build with engine-sherpa,metal was ahead of what v0.24.0 shipped. Thanks again, this was caught days before it would have gone into a release.