[Store] Fix Rust store build path#2114
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for Mooncake Store Rust bindings by updating documentation and enhancing the build system. Key changes include adding libclang as a dependency, correcting CMake option names in the documentation, and providing a comprehensive README for the Rust component. The build.rs script was updated to automatically discover library paths by parsing CMakeCache.txt. A review comment identifies an improvement opportunity in the build script to correctly handle semicolon-separated library lists in the CMake cache, ensuring all dependency directories are properly identified.
| if key.ends_with("_LIBRARY:FILEPATH") || key.ends_with("_LIBRARIES:FILEPATH") { | ||
| let library_path = PathBuf::from(value); | ||
| if let Some(parent) = library_path.parent() { | ||
| push_existing_dir(search_dirs, parent.to_path_buf()); | ||
| } | ||
| } |
There was a problem hiding this comment.
CMake variables ending in _LIBRARIES often contain a semicolon-separated list of library paths (for example, GLOG_LIBRARIES:FILEPATH=/usr/lib/libglog.so;/usr/lib/libgflags.so). The current implementation treats the entire string as a single path, which will fail to resolve the parent directory correctly if multiple paths are present. Splitting the value by ; ensures that all library directories are correctly identified.
if key.ends_with("_LIBRARY:FILEPATH") || key.ends_with("_LIBRARIES:FILEPATH") {
for path_str in value.split(';').filter(|s| !s.is_empty()) {
let library_path = PathBuf::from(path_str);
if let Some(parent) = library_path.parent() {
push_existing_dir(search_dirs, parent.to_path_buf());
}
}
}|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Description
Fixes #2069.
This PR fixes the Mooncake Store Rust standalone build path so Rust examples and tests link against the same native libraries selected by the CMake build.
The main issue was that standalone Cargo builds could pick up a different system copy of native dependencies, such as
glog, instead of the dependency used by CMake.mooncake-store/rust/build.rsnow reads library search paths from the CMake build context, includingMOONCAKE_BUILD_DIR, the default../../build/CMakeCache.txt, andCMAKE_PREFIX_PATH.This PR also adds Rust Store build/test documentation and fixes the stale
WITH_WITH_RUST_EXAMPLECMake option in the docs.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-pg)mooncake-rl)Type of Change
How Has This Been Tested?