From 429113175aec8034cc1a44a0a95ee17c8b3385ad Mon Sep 17 00:00:00 2001 From: Bossiara13 <236771060+DmitryBykov-ISPO@users.noreply.github.com> Date: Fri, 15 May 2026 01:32:17 +0300 Subject: [PATCH] build(core): add build.rs so cargo test links against libvosk cargo test on jarvis-core was failing with `LNK1181 cannot open input file "libvosk.lib"`. The link-search path is declared in jarvis-app's build.rs (and jarvis-cli's), but the test binary for jarvis-core has no such config and the workspace .cargo/config.toml didn't cover it. Adds a minimal build.rs that emits `cargo:rustc-link-search=native=...` pointing at lib/windows/amd64 (resolved relative to CARGO_MANIFEST_DIR, no hardcoded absolute paths so the project still builds for anyone cloning under a different drive/path). Verified: cargo test -p jarvis-core --lib commands::tests now passes 3/3 (every_command_toml_parses, lua_command_scripts_exist, every_command_has_phrases). --- crates/jarvis-core/build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 crates/jarvis-core/build.rs diff --git a/crates/jarvis-core/build.rs b/crates/jarvis-core/build.rs new file mode 100644 index 0000000..4ee99e7 --- /dev/null +++ b/crates/jarvis-core/build.rs @@ -0,0 +1,12 @@ +use std::path::PathBuf; + +fn main() { + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"); + + let lib_path = PathBuf::from(&manifest_dir) + .parent().expect("crate parent") + .parent().expect("workspace parent") + .join("lib").join("windows").join("amd64"); + + println!("cargo:rustc-link-search=native={}", lib_path.display()); +}