Skip to content

Commit 5c667e4

Browse files
authored
Merge pull request #2 from transcriptintel/develop
v1.2.1 — Portable binary distribution, docs
2 parents c6d60d9 + ee652db commit 5c667e4

File tree

5 files changed

+68
-4
lines changed

5 files changed

+68
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "transcribeit"
3-
version = "1.2.0"
3+
version = "1.2.1"
44
edition = "2024"
55
license-file = "LICENSE"
66

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,34 @@ DIARIZE_SEGMENTATION_MODEL=.cache/sherpa-onnx-pyannote-segmentation-3-0/model.on
116116
DIARIZE_EMBEDDING_MODEL=.cache/wespeaker_en_voxceleb_CAM++.onnx
117117
```
118118

119+
## Binary distribution
120+
121+
Pre-built binaries can be deployed without Rust or build tools. The binary needs FFmpeg on PATH and the sherpa-onnx shared libraries alongside it:
122+
123+
```
124+
transcribeit # binary
125+
lib/ # sherpa-onnx shared libraries
126+
libsherpa-onnx-c-api.dylib
127+
libonnxruntime.dylib
128+
```
129+
130+
On first run, use `transcribeit setup` to download models and additional components. The binary looks for shared libraries in `lib/` relative to itself — no environment variables needed at runtime.
131+
132+
To build a distributable binary:
133+
134+
```bash
135+
cargo build --release
136+
# Copy binary + libs
137+
cp target/release/transcribeit dist/
138+
cp vendor/sherpa-onnx-*/lib/lib*.dylib dist/lib/
139+
```
140+
141+
To build without sherpa-onnx (no shared library dependency):
142+
143+
```bash
144+
cargo build --release --no-default-features
145+
```
146+
119147
## License
120148

121149
This project is licensed under the [Business Source License 1.1](LICENSE).

build.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@ fn main() {
1515
path.to_path_buf()
1616
};
1717

18-
// Tell the linker where to find the shared libs
18+
// Tell the linker where to find the shared libs at build time
1919
println!("cargo:rustc-link-search=native={}", absolute.display());
2020

21-
// Embed rpath so the binary finds dylibs at runtime
21+
// Embed rpaths for runtime dylib resolution:
22+
// 1. @executable_path/lib — for portable distribution (dylibs next to binary in lib/)
23+
// 2. @executable_path — for dylibs in the same directory as the binary
24+
// 3. The absolute build-time path — for development convenience
25+
if cfg!(target_os = "macos") {
26+
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/lib");
27+
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
28+
} else {
29+
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN/lib");
30+
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
31+
}
32+
// Also keep the build-time path for local development
2233
println!("cargo:rustc-link-arg=-Wl,-rpath,{}", absolute.display());
2334
}
2435

docs/troubleshooting.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,28 @@ Fix:
213213
SenseVoice models are capable of detecting emotions and audio events (laughter, applause, music, etc.), but the sherpa-onnx C API strips these tags from the output. Only the transcription text is available. This is a limitation of the sherpa-onnx C-level bindings, not of transcribeit.
214214

215215
Additionally, the SenseVoice 2025 model is a quality regression compared to the 2024 version. Prefer using the 2024 SenseVoice model for best results.
216+
217+
### Binary fails with "Library not loaded: libsherpa-onnx-c-api.dylib"
218+
219+
Symptoms:
220+
- `dyld: Library not loaded: @rpath/libsherpa-onnx-c-api.dylib`
221+
- Binary crashes immediately on startup
222+
223+
Fix: The binary expects sherpa-onnx shared libraries in a `lib/` directory next to itself:
224+
225+
```
226+
transcribeit # binary
227+
lib/ # create this directory
228+
libsherpa-onnx-c-api.dylib
229+
libonnxruntime.dylib
230+
libonnxruntime.1.23.2.dylib
231+
```
232+
233+
Copy the dylibs from `vendor/sherpa-onnx-*/lib/` or download them with `transcribeit setup -c sherpa-libs`.
234+
235+
If you see a hardcoded path from another machine (e.g., `/Users/someone/...`), the binary was built with an old `build.rs`. Rebuild with the latest code — the portable `@executable_path/lib` rpath is now used.
236+
237+
To avoid this dependency entirely, build without sherpa-onnx:
238+
```bash
239+
cargo build --release --no-default-features
240+
```

0 commit comments

Comments
 (0)