Skip to content

Commit f6862ac

Browse files
committed
build: workaround for windows/vulkan filetracker errors
1 parent 2562914 commit f6862ac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

llama-cpp-sys-2/build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,17 @@ fn main() {
356356
let vulkan_lib_path = Path::new(&vulkan_path).join("Lib");
357357
println!("cargo:rustc-link-search={}", vulkan_lib_path.display());
358358
println!("cargo:rustc-link-lib=vulkan-1");
359+
360+
// workaround for this error: "FileTracker : error FTK1011: could not create the new file tracking log file"
361+
// it has to do with MSBuild FileTracker not respecting the path
362+
// limit configuration set in the windows registry.
363+
// I'm not sure why that's a thing, but this makes my builds work.
364+
// (crates that depend on llama-cpp-rs w/ vulkan easily exceed the default PATH_MAX on windows)
365+
env::set_var("TrackFileAccess", "false");
366+
// since we disabled TrackFileAccess, we can now run into problems with parallel
367+
// access to pdb files. /FS solves this.
368+
config.cflag("/FS");
369+
config.cxxflag("/FS");
359370
}
360371
TargetOs::Linux => {
361372
println!("cargo:rustc-link-lib=vulkan");

0 commit comments

Comments
 (0)