Repository navigation
fix(core): accept a directory in ORT_LIB_PATH when the library is inside - #1460
Merged
Merged
Conversation
…ide (#1459) The Homebrew shims exported the libexec directory as ORT_LIB_PATH. dlopen fails on a directory, so every Homebrew install since v0.19.0 stored memories without embeddings. Resolve a directory to the platform library inside it, with a warning, and fail with a clear message when the library is not there.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
resolve_ort_lib()(crates/uteke-core/src/embed/ort_init.rs) now handles anORT_LIB_PATHthat is a directory. The explicit-path check moved into a pure function,resolve_explicit_ort_path:ORT_LIB_PATHlibonnxruntime.so/.dylib/onnxruntime.dllwarn!telling the user to set the fileORT_LIB_PATH '<dir>' is a directory with no <name> inside; set it to the library fileAlso adds a CHANGELOG
### Fixedentry under[Unreleased].Closes #1459.
Why
Every Homebrew install of uteke since v0.19.0 stores memories without embeddings, silently. The tap's shims export
ORT_LIB_PATH=<libexec>(a directory). uteke dlopens exactly that path anddlopenfails on a directory, so memories are stored FTS5-only (embedding_written: false) anduteke verifyreports a MISMATCH with 0 vectors. The docs sayORT_LIB_PATHis the library file.The tap fix is codecoradev/homebrew-tap#10. That fixes users after
brew reinstall, without a uteke release. This PR makes uteke tolerant of the same misconfiguration, so it cannot fail silently again.Docker and the release tarballs are not affected.
Testing
New unit tests, with no process-environment mutation. They use temp dirs against the pure function and assert exact values and messages:
explicit_path_to_a_file_is_used_as_isexplicit_path_to_a_directory_finds_the_library_insideexplicit_path_to_a_directory_without_the_library_is_an_errorexplicit_path_that_does_not_exist_is_an_errorThe existing
resolve_ort_lib_env_var_overridetest is unchanged and still passes.cargo test --workspace: all green (uteke-core 739 passed, 33 ignored ONNX-only).cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warnings: clean.End to end on macOS arm64 with the v0.21.0 release tarball and a real EmbeddingGemma model,
uteke rememberthenuteke verify:ORT_LIB_PATHlibexec(directory)libexec(directory)embedding_written: true, 1 vectorlibexec/libonnxruntime.dylib(file)embedding_written: true, 1 vector (unchanged)Found while testing, not changed here: CLI tracing output goes to stdout, so any WARN (including this PR's new one) is printed before the JSON and breaks
--jsonparsing. Tracked separately in cli: tracing output goes to stdout and corrupts --json output #1461.