rust: support linking a prebuilt install via TRANSCRIBE_DIR - #117
Open
shaba wants to merge 1 commit into
Open
Conversation
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.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the system/prebuilt linking path requested in #97 to the Rust sys crate.
When
TRANSCRIBE_DIRpoints to an install prefix (produced bycmake --installof a
TRANSCRIBE_INSTALL=ONbuild), the vendored cmake build is skipped and thelink line is emitted from that prefix's
lib*/transcribe-link.jsonvia theexisting
find_manifest/emit_link_lines— no new link logic. Both static andshared prefixes work. With
TRANSCRIBE_DIRunset, 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 thelinked library. A bogus
TRANSCRIBE_DIRfails fast with a clear message.