libafl_libfuzzer: replace cargo:error with assert in build.rs (#1517)

It is very confusing if you are trying to build on MacOS
and it is telling you that it worked, but actually it didn't.
This commit is contained in:
Elnard Utiushev 2023-09-15 19:53:33 -04:00 committed by GitHub
parent acecf46fb9
commit d4f47340a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,12 +4,11 @@ fn main() {
if cfg!(any(feature = "cargo-clippy", docsrs)) {
return; // skip when clippy or docs is running
}
if cfg!(not(target_os = "linux")) {
println!(
"cargo:error=The libafl_libfuzzer runtime may only be built for linux; failing fast."
);
return;
}
assert!(
cfg!(target_os = "linux"),
"The libafl_libfuzzer runtime may only be built for linux; failing fast."
);
println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/src");
println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/Cargo.toml");
println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/build.rs");