From 9f7638666890956d124b0c75f50d572877a9c03b Mon Sep 17 00:00:00 2001 From: Evan Richter Date: Sat, 1 Jan 2022 18:03:35 -0600 Subject: [PATCH] [libafl_qemu] prevent unneeded build.rs runs (#441) `libqasan/libqasan.so` never exists during a normal `cargo build` because the .so is built in the target_dir, not in the source directory. This was triggering cargo to rerun the build script every time a user of this library made an incremental change to their code. pointing `rerun-if-changed` to a directory will make cargo rerun build.rs if any file in that directory changes. --- libafl_qemu/build.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libafl_qemu/build.rs b/libafl_qemu/build.rs index efb906b8f1..48f3baad49 100644 --- a/libafl_qemu/build.rs +++ b/libafl_qemu/build.rs @@ -76,13 +76,8 @@ fn main() { let qasan_dir = Path::new("libqasan"); let qasan_dir = fs::canonicalize(&qasan_dir).unwrap(); let src_dir = Path::new("src"); - //let cwd = env::current_dir().unwrap().to_string_lossy().to_string(); - println!("cargo:rerun-if-changed={}/libqasan.so", qasan_dir.display()); - println!( - "cargo:rerun-if-changed={}/libqasan.so", - target_dir.display() - ); + println!("cargo:rerun-if-changed=libqasan"); build_dep_check(&["git", "make"]);