Use portable USearch on macOS.

This commit is contained in:
Hermes Agent
2026-08-14 09:45:02 +00:00
parent 27470465a7
commit 1424d59845
3 changed files with 20 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ libsqlite3-sys = { version = "0.37.0", features = ["bundled"] }
mlua = { version = "0.12", features = ["lua54", "vendored", "serialize"] }
url = "2.5"
fastembed = { version = "5.17.3", default-features = false, features = ["hf-hub-rustls-tls", "ort-download-binaries-rustls-tls"] }
usearch = "2.26"
usearch = { version = "2.26", default-features = false }
ort = { version = "=2.0.0-rc.12", default-features = false, features = ["std", "api-24", "coreml", "directml"] }
russh = "0.62.5"
ratatui = "0.30.2"

View File

@@ -45,9 +45,14 @@ url = { workspace = true }
base64 = { workspace = true }
dirs = { workspace = true }
fastembed = { workspace = true }
usearch = { workspace = true }
ort = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
usearch = { workspace = true }
[target.'cfg(not(target_os = "macos"))'.dependencies]
usearch = { workspace = true, features = ["numkong"] }
[dev-dependencies]
tempfile = "3"

View File

@@ -167,6 +167,19 @@ fn tagged_releases_are_built_and_packaged_with_rust_tools() {
);
}
let workspace_manifest = fs::read_to_string(workspace.join("Cargo.toml")).unwrap();
let core_manifest = fs::read_to_string(workspace.join("crates/bds-core/Cargo.toml")).unwrap();
assert!(
workspace_manifest.contains("usearch = { version = \"2.26\", default-features = false }"),
"USearch SIMD backends must be selected explicitly per target"
);
assert!(
core_manifest.contains("[target.'cfg(target_os = \"macos\")'.dependencies]")
&& core_manifest.contains("[target.'cfg(not(target_os = \"macos\"))'.dependencies]")
&& core_manifest.contains("usearch = { workspace = true, features = [\"numkong\"] }"),
"macOS must use portable USearch while native targets keep NumKong SIMD"
);
let release_source =
fs::read_to_string(workspace.join("crates/bds-release/src/packaging.rs")).unwrap();
assert!(release_source.contains("LC_ID_DYLIB"));