diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b8b807e494..8e47e726d4 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -2,9 +2,9 @@ name: Build and Test on: push: - branches: [ main, dev ] + branches: [ main ] pull_request: - branches: [ main, dev ] + branches: [ main ] env: CARGO_TERM_COLOR: always @@ -36,18 +36,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Default Build + - name: Install cargo-hack + run: curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin + - name: Run a normal build run: cargo build --verbose - - name: Default Test - run: cargo test --verbose - - name: Build all features - run: cd libafl && cargo build --all-features --verbose - - name: Test all features - run: cd libafl && cargo test --all-features --verbose - - name: Build no_std - run: cd libafl && cargo build --no-default-features --verbose - - name: Test no_std - run: cd libafl && cargo test --no-default-features --verbose + # cargo-hack tests/checks each crate in the workspace + - name: Run tests + run: cargo hack test --all-features + # cargo-hack's --feature-powerset would be nice here but libafl has a too many knobs + - name: Check each feature + run: cargo hack check --each-feature - name: Build examples run: cargo build --examples --verbose - uses: actions/checkout@v2 diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index f43956f647..58f57ea890 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -37,7 +37,7 @@ harness = false [features] default = ["std", "anymap_debug", "derive", "llmp_compression"] -std = [] # print, env, launcher ... support +std = ["serde_json"] # print, env, launcher ... support anymap_debug = ["serde_json"] # uses serde_json to Debug the anymap trait. Disable for smaller footprint. derive = ["libafl_derive"] # provide derive(SerdeAny) macro. llmp_bind_public = [] # If set, llmp will bind to 0.0.0.0, allowing cross-device communication. Binds to localhost by default. diff --git a/libafl/src/events/mod.rs b/libafl/src/events/mod.rs index d1e08e6715..bbbbfe1998 100644 --- a/libafl/src/events/mod.rs +++ b/libafl/src/events/mod.rs @@ -13,6 +13,8 @@ use crate::{inputs::Input, observers::ObserversTuple, stats::UserStats, Error}; #[cfg(feature = "introspection")] use crate::stats::ClientPerfStats; +#[cfg(feature = "introspection")] +use alloc::boxed::Box; /// The log event severity #[derive(Serialize, Deserialize, Debug, Clone, Copy)] diff --git a/libafl/src/fuzzer.rs b/libafl/src/fuzzer.rs index ecede5cee0..45a01d6f89 100644 --- a/libafl/src/fuzzer.rs +++ b/libafl/src/fuzzer.rs @@ -17,6 +17,8 @@ use crate::{ #[cfg(feature = "introspection")] use crate::stats::PerfFeature; +#[cfg(feature = "introspection")] +use alloc::boxed::Box; use alloc::string::ToString; use core::{marker::PhantomData, time::Duration};