Skip to content

rust: support linking a prebuilt install via TRANSCRIBE_DIR - #117

Open
shaba wants to merge 1 commit into
handy-computer:mainfrom
shaba:rust-sys-system-prefix
Open

rust: support linking a prebuilt install via TRANSCRIBE_DIR#117
shaba wants to merge 1 commit into
handy-computer:mainfrom
shaba:rust-sys-system-prefix

Conversation

@shaba

@shaba shaba commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Adds the system/prebuilt linking path requested in #97 to the Rust sys crate.
When TRANSCRIBE_DIR points to an install prefix (produced by cmake --install
of a TRANSCRIBE_INSTALL=ON build), the vendored cmake build is skipped and the
link line is emitted from that prefix's lib*/transcribe-link.json via the
existing find_manifest/emit_link_lines — no new link logic. Both static and
shared prefixes work. With TRANSCRIBE_DIR unset, behavior is unchanged
(insertion-only early return before the cmake step).

This is mainly for distro packaging: one system-wide libtranscribe package,
Rust consumers link against it instead of rebuilding ggml per project.

AI Assistance

AI assisted with the implementation and docs; I reviewed, tested and own the
change.

Validation

Built a shared install prefix, then built and tested a downstream consumer
against it with TRANSCRIBE_DIR — cmake is skipped, tests pass against the
linked library. A bogus TRANSCRIBE_DIR fails fast with a clear message.

Setting TRANSCRIBE_DIR (OPENSSL_DIR-style) to an install prefix produced
by cmake --install of a TRANSCRIBE_INSTALL=ON build skips the vendored
source build entirely: the link line is emitted from that prefix's
lib*/transcribe-link.json through the existing find_manifest /
emit_link_lines path, so static and shared prefixes both work with no
new link logic. Cargo features are inert on this path (the prebuilt
already fixed its configuration; the manifest records it). Unset, the
source build is byte-identical to before.
@cjpais

cjpais commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Thank you. I appreciate you submitting the fix. I will try to take a look soon. Most likely, I'll take a look next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants