From 888079aea5becb5ddd9ca5c8a767d26123163e17 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Sat, 15 Jun 2024 16:26:31 +0200 Subject: [PATCH] Fix publish errors (#2313) * Fix publish errors * publish.sh * remove include_str readme in libafl_qemu * execute libafl_qemu_build::maybe_generate_stub_bindings() only if in cargo doc --- libafl_frida/Cargo.toml | 4 ++-- libafl_qemu/libafl_qemu_build/src/lib.rs | 3 ++- libafl_qemu/src/lib.rs | 1 - scripts/publish.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libafl_frida/Cargo.toml b/libafl_frida/Cargo.toml index 46efae8805..0e895d0cac 100644 --- a/libafl_frida/Cargo.toml +++ b/libafl_frida/Cargo.toml @@ -104,5 +104,5 @@ winsafe = {version = "0.0.21", features = ["kernel"]} serial_test = { version = "3", default-features = false, features = ["logging"] } clap = {version = "4.5", features = ["derive"]} libloading = "0.8" -mimalloc = { version = "*", default-features = false } -dlmalloc ={version = "0.2.6", features = ["global"]} \ No newline at end of file +mimalloc = { version = "0.1", default-features = false } +dlmalloc ={version = "0.2.6", features = ["global"]} diff --git a/libafl_qemu/libafl_qemu_build/src/lib.rs b/libafl_qemu/libafl_qemu_build/src/lib.rs index 631263a31b..5845321f3a 100644 --- a/libafl_qemu/libafl_qemu_build/src/lib.rs +++ b/libafl_qemu/libafl_qemu_build/src/lib.rs @@ -306,6 +306,7 @@ pub fn store_generated_content_if_different( .unwrap_or_else(|_| panic!("Unable to write in {}", file_to_update.display())); } } + #[rustversion::nightly] pub fn maybe_generate_stub_bindings( cpu_target: &str, @@ -313,7 +314,7 @@ pub fn maybe_generate_stub_bindings( stub_bindings_file: &Path, bindings_file: &Path, ) { - if cpu_target == "x86_64" && emulation_mode == "usermode" { + if env::var("CARGO_CFG_DOC").is_ok() && cpu_target == "x86_64" && emulation_mode == "usermode" { let current_rustc_version = rustc_version::version().expect("Could not get current rustc version"); let semver_re = Regex::new(r"/\* (.*) \*/").unwrap(); diff --git a/libafl_qemu/src/lib.rs b/libafl_qemu/src/lib.rs index ad21721b2d..f92855c0f7 100644 --- a/libafl_qemu/src/lib.rs +++ b/libafl_qemu/src/lib.rs @@ -1,7 +1,6 @@ //! Welcome to `LibAFL` QEMU //! //! __Warning__: The documentation is built by default for `x86_64` in `usermode`. To access the documentation of other architectures or `systemmode`, the documentation must be rebuilt with the right features. -#![doc = include_str!("../../README.md")] /*! */ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] #![forbid(unexpected_cfgs)] diff --git a/scripts/publish.sh b/scripts/publish.sh index fdd0fbbdbb..64cd736e44 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -74,7 +74,7 @@ if git submodule status | grep "^-">/dev/null ; then \ fi cd libafl_concolic/symcc_runtime -cargo publish "$@" +cargo publish "$@" --allow-dirty cd ../.. || exit 1 cd libafl_libfuzzer