From b2aa713ee5803c988929ed7d761b5a44da7db842 Mon Sep 17 00:00:00 2001 From: Marcus Dunn Date: Tue, 17 Jun 2025 00:34:53 +0000 Subject: [PATCH 1/3] updated llama.cpp --- llama-cpp-sys-2/llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama-cpp-sys-2/llama.cpp b/llama-cpp-sys-2/llama.cpp index 259469c4..e434e691 160000 --- a/llama-cpp-sys-2/llama.cpp +++ b/llama-cpp-sys-2/llama.cpp @@ -1 +1 @@ -Subproject commit 259469c4b57c1a32606353bcac52ba683424a990 +Subproject commit e434e69183fd9e1031f4445002083178c331a28b From fbf6887c9aeee5da2acadeb42e9ff0808538a324 Mon Sep 17 00:00:00 2001 From: AsbjornOlling Date: Tue, 17 Jun 2025 12:33:01 +0200 Subject: [PATCH 2/3] bump llamacpp, remove weird build-info.cpp copy --- llama-cpp-sys-2/Cargo.toml | 12 ------------ llama-cpp-sys-2/build.rs | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/llama-cpp-sys-2/Cargo.toml b/llama-cpp-sys-2/Cargo.toml index 3dd9b94e..068204da 100644 --- a/llama-cpp-sys-2/Cargo.toml +++ b/llama-cpp-sys-2/Cargo.toml @@ -24,18 +24,6 @@ include = [ "/llama.cpp/convert_hf_to_gguf.py", # Yes, it's required - # Erroneously the llama.cpp code currently generates the build-info.cpp - # into the source directory of the build instead of into the target directory - # as it should. Will try submitting something upstream to clean this up as - # well but for now explictly exclude this from the build. Previously this was - # implicitly excluded because the llama.cpp code was copied wholesale into the - # target directory for building which is why this problem wasn't visible before - # (i.e. we'd package the llama.cpp source from the submodule & thus this build-info.cpp - # generated file would still be ignored because it would only exist in the separate - # copy within the target directory. An alternative, if we do want to capture build-info.cpp - # within the package would be to change the CI task to add `--allow-dirty` to the package - # command. - "!/llama.cpp/common/build-info.cpp", "/llama.cpp/common/build-info.cpp.in", "/llama.cpp/ggml/src/ggml-cuda.cu", diff --git a/llama-cpp-sys-2/build.rs b/llama-cpp-sys-2/build.rs index 8e94e81d..cd5c036d 100644 --- a/llama-cpp-sys-2/build.rs +++ b/llama-cpp-sys-2/build.rs @@ -388,18 +388,6 @@ fn main() { .always_configure(false); let build_dir = config.build(); - let build_info_src = llama_src.join("common/build-info.cpp"); - let build_info_target = build_dir.join("build-info.cpp"); - std::fs::rename(&build_info_src,&build_info_target).unwrap_or_else(|move_e| { - // Rename may fail if the target directory is on a different filesystem/disk from the source. - // Fall back to copy + delete to achieve the same effect in this case. - std::fs::copy(&build_info_src, &build_info_target).unwrap_or_else(|copy_e| { - panic!("Failed to rename {build_info_src:?} to {build_info_target:?}. Move failed with {move_e:?} and copy failed with {copy_e:?}"); - }); - std::fs::remove_file(&build_info_src).unwrap_or_else(|e| { - panic!("Failed to delete {build_info_src:?} after copying to {build_info_target:?}: {e:?} (move failed because {move_e:?})"); - }); - }); // Search paths println!("cargo:rustc-link-search={}", out_dir.join("lib").display()); From a92e90b2875238036a547b1854aefaefa2f8f59f Mon Sep 17 00:00:00 2001 From: AsbjornOlling Date: Wed, 18 Jun 2025 11:42:21 +0200 Subject: [PATCH 3/3] explicitly link advapi32 on windows --- llama-cpp-sys-2/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/llama-cpp-sys-2/build.rs b/llama-cpp-sys-2/build.rs index cd5c036d..4ad80680 100644 --- a/llama-cpp-sys-2/build.rs +++ b/llama-cpp-sys-2/build.rs @@ -440,6 +440,7 @@ fn main() { match target_os { TargetOs::Windows(WindowsVariant::Msvc) => { + println!("cargo:rustc-link-lib=advapi32"); if cfg!(debug_assertions) { println!("cargo:rustc-link-lib=dylib=msvcrtd"); }