From 9458549fef803cea0879dfa524d50f6258d85aae Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Fri, 30 Dec 2022 02:02:38 +0900 Subject: [PATCH] Remove declare -A (#976) * fix * fix * debug * debug * older version * newer version * fix * unix? * fix --- libafl/src/bolts/cli.rs | 2 +- libafl/src/monitors/mod.rs | 3 +-- libafl_targets/src/lib.rs | 4 ++-- scripts/test_all_fuzzers.sh | 14 +------------- utils/build_and_test_fuzzers/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 19 deletions(-) diff --git a/libafl/src/bolts/cli.rs b/libafl/src/bolts/cli.rs index c5d26f1373..87be0fa296 100644 --- a/libafl/src/bolts/cli.rs +++ b/libafl/src/bolts/cli.rs @@ -282,7 +282,7 @@ pub struct FuzzerOptions { pub cores: Cores, /// port on which the broker should listen - #[arg(short = 'p', long, default_value = "31337", value_name = "PORT")] + #[arg(short = 'p', long, default_value = "1337", value_name = "PORT")] pub broker_port: u16, /// ip:port where a remote broker is already listening diff --git a/libafl/src/monitors/mod.rs b/libafl/src/monitors/mod.rs index 4f62d84ca5..8f74a47a20 100644 --- a/libafl/src/monitors/mod.rs +++ b/libafl/src/monitors/mod.rs @@ -16,8 +16,7 @@ pub use prometheus::PrometheusMonitor; #[cfg(feature = "std")] pub mod disk; use alloc::{fmt::Debug, string::String, vec::Vec}; -use core::fmt::Write; -use core::{fmt, time::Duration}; +use core::{fmt, fmt::Write, time::Duration}; #[cfg(feature = "std")] pub use disk::{OnDiskJSONMonitor, OnDiskTOMLMonitor}; diff --git a/libafl_targets/src/lib.rs b/libafl_targets/src/lib.rs index 626e743701..5c619f0f94 100644 --- a/libafl_targets/src/lib.rs +++ b/libafl_targets/src/lib.rs @@ -106,7 +106,7 @@ pub mod windows_asan; #[cfg(all(windows, feature = "std"))] pub use windows_asan::*; -#[cfg(any(target_os = "linux", target_os = "freebsd"))] +#[cfg(unix)] pub mod forkserver; -#[cfg(any(target_os = "linux", target_os = "freebsd"))] +#[cfg(unix)] pub use forkserver::*; diff --git a/scripts/test_all_fuzzers.sh b/scripts/test_all_fuzzers.sh index 83b786ce87..544d0a5266 100755 --- a/scripts/test_all_fuzzers.sh +++ b/scripts/test_all_fuzzers.sh @@ -2,7 +2,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" cd "$SCRIPT_DIR/.." || exit 1 - # TODO: This should be rewritten in rust, a Makefile, or some platform-independent language if [[ -z "${RUN_ON_CI}" ]]; then @@ -37,9 +36,6 @@ do export CARGO_PROFILE_"$profile"_INCREMENTAL=true done -# record time of each fuzzer -declare -A time_record || (echo "declare -A not avaliable, please update your bash version to 4";exit 1) - # shellcheck disable=SC2116 for fuzzer in $(echo "$fuzzers" "$backtrace_fuzzers"); do @@ -49,7 +45,6 @@ do fi cd "$fuzzer" || exit 1 - start=$(date +%s) # Clippy checks if [ "$1" != "--no-fmt" ]; then @@ -74,8 +69,6 @@ do cargo build || exit 1 echo "[+] Done building $fuzzer" fi - end=$(date +%s) - time_record[$fuzzer]=$((end-start)) du -sh "$CARGO_TARGET_DIR" # Save disk space cargo clean -p "$(basename "$fuzzer")" @@ -89,9 +82,4 @@ do du -sh "$CARGO_TARGET_DIR" cd "$libafl" || exit 1 echo "" -done - -# print time for each fuzzer -for key in "${!time_record[@]}"; do - echo "dir: $key, time: ${time_record[$key]}"; -done +done \ No newline at end of file diff --git a/utils/build_and_test_fuzzers/Cargo.toml b/utils/build_and_test_fuzzers/Cargo.toml index 2b14802d1e..ee811fe8d0 100644 --- a/utils/build_and_test_fuzzers/Cargo.toml +++ b/utils/build_and_test_fuzzers/Cargo.toml @@ -10,5 +10,5 @@ keywords = ["ci"] categories = ["development-tools::testing"] [dependencies] -cargo_toml = "0.13" +cargo_toml = "0.14" walkdir = "2"