mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 22:15:18 +00:00
- Add README.md to patches/ explaining the critical hnsw_rs patch - Run cargo fmt on ruvector-postgres to fix formatting issues The patches/hnsw_rs directory is REQUIRED for builds as it provides a WASM-compatible version of hnsw_rs (using rand 0.8 instead of 0.9). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Patches Directory
CRITICAL: Do not delete this directory or its contents!
This directory contains patched versions of external crates that are necessary for building RuVector.
hnsw_rs
The hnsw_rs directory contains a patched version of the hnsw_rs crate.
Why this patch exists
The official hnsw_rs crate uses rand 0.9 which is incompatible with WebAssembly (WASM) builds. This patched version:
- Uses
rand 0.8instead ofrand 0.9for WASM compatibility - Uses Rust edition 2021 (not 2024) for stable Rust toolchain compatibility
How it's used
The patch is applied via Cargo.toml at the workspace root:
[patch.crates-io]
hnsw_rs = { path = "./patches/hnsw_rs" }
This ensures all workspace crates that depend on hnsw_rs use this patched version.
What depends on it
ruvector-core(withhnswfeature enabled by default)ruvector-graph(withhnsw_rsfeature)- All native builds (Node.js bindings, CLI tools)
Consequences of deletion
If this directory is deleted:
- All CI builds will fail (Build Native Modules, PostgreSQL Extension CI, etc.)
cargo buildwill fail with "failed to load source for dependencyhnsw_rs"- The project cannot be compiled
Updating the patch
If you need to update hnsw_rs:
- Download the new version from crates.io
- Apply the rand 0.8 compatibility changes from the current patch
- Test WASM and native builds before committing