Remove declare -A (#976)

* fix

* fix

* debug

* debug

* older version

* newer version

* fix

* unix?

* fix
This commit is contained in:
Dongjia "toka" Zhang 2022-12-30 02:02:38 +09:00 committed by GitHub
parent 3e38862837
commit 9458549fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 19 deletions

View File

@ -282,7 +282,7 @@ pub struct FuzzerOptions {
pub cores: Cores, pub cores: Cores,
/// port on which the broker should listen /// 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, pub broker_port: u16,
/// ip:port where a remote broker is already listening /// ip:port where a remote broker is already listening

View File

@ -16,8 +16,7 @@ pub use prometheus::PrometheusMonitor;
#[cfg(feature = "std")] #[cfg(feature = "std")]
pub mod disk; pub mod disk;
use alloc::{fmt::Debug, string::String, vec::Vec}; use alloc::{fmt::Debug, string::String, vec::Vec};
use core::fmt::Write; use core::{fmt, fmt::Write, time::Duration};
use core::{fmt, time::Duration};
#[cfg(feature = "std")] #[cfg(feature = "std")]
pub use disk::{OnDiskJSONMonitor, OnDiskTOMLMonitor}; pub use disk::{OnDiskJSONMonitor, OnDiskTOMLMonitor};

View File

@ -106,7 +106,7 @@ pub mod windows_asan;
#[cfg(all(windows, feature = "std"))] #[cfg(all(windows, feature = "std"))]
pub use windows_asan::*; pub use windows_asan::*;
#[cfg(any(target_os = "linux", target_os = "freebsd"))] #[cfg(unix)]
pub mod forkserver; pub mod forkserver;
#[cfg(any(target_os = "linux", target_os = "freebsd"))] #[cfg(unix)]
pub use forkserver::*; pub use forkserver::*;

View File

@ -2,7 +2,6 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR/.." || exit 1 cd "$SCRIPT_DIR/.." || exit 1
# TODO: This should be rewritten in rust, a Makefile, or some platform-independent language # TODO: This should be rewritten in rust, a Makefile, or some platform-independent language
if [[ -z "${RUN_ON_CI}" ]]; then if [[ -z "${RUN_ON_CI}" ]]; then
@ -37,9 +36,6 @@ do
export CARGO_PROFILE_"$profile"_INCREMENTAL=true export CARGO_PROFILE_"$profile"_INCREMENTAL=true
done 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 # shellcheck disable=SC2116
for fuzzer in $(echo "$fuzzers" "$backtrace_fuzzers"); for fuzzer in $(echo "$fuzzers" "$backtrace_fuzzers");
do do
@ -49,7 +45,6 @@ do
fi fi
cd "$fuzzer" || exit 1 cd "$fuzzer" || exit 1
start=$(date +%s)
# Clippy checks # Clippy checks
if [ "$1" != "--no-fmt" ]; then if [ "$1" != "--no-fmt" ]; then
@ -74,8 +69,6 @@ do
cargo build || exit 1 cargo build || exit 1
echo "[+] Done building $fuzzer" echo "[+] Done building $fuzzer"
fi fi
end=$(date +%s)
time_record[$fuzzer]=$((end-start))
du -sh "$CARGO_TARGET_DIR" du -sh "$CARGO_TARGET_DIR"
# Save disk space # Save disk space
cargo clean -p "$(basename "$fuzzer")" cargo clean -p "$(basename "$fuzzer")"
@ -89,9 +82,4 @@ do
du -sh "$CARGO_TARGET_DIR" du -sh "$CARGO_TARGET_DIR"
cd "$libafl" || exit 1 cd "$libafl" || exit 1
echo "" echo ""
done done
# print time for each fuzzer
for key in "${!time_record[@]}"; do
echo "dir: $key, time: ${time_record[$key]}";
done

View File

@ -10,5 +10,5 @@ keywords = ["ci"]
categories = ["development-tools::testing"] categories = ["development-tools::testing"]
[dependencies] [dependencies]
cargo_toml = "0.13" cargo_toml = "0.14"
walkdir = "2" walkdir = "2"