[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.
This commit is contained in:
Evan Richter 2022-01-01 18:03:35 -06:00 committed by GitHub
parent cb3662da54
commit 9f76386668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,13 +76,8 @@ fn main() {
let qasan_dir = Path::new("libqasan"); let qasan_dir = Path::new("libqasan");
let qasan_dir = fs::canonicalize(&qasan_dir).unwrap(); let qasan_dir = fs::canonicalize(&qasan_dir).unwrap();
let src_dir = Path::new("src"); 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");
println!(
"cargo:rerun-if-changed={}/libqasan.so",
target_dir.display()
);
build_dep_check(&["git", "make"]); build_dep_check(&["git", "make"]);