From 34ec9074568a31d3b3253d27834737aae2dbf3f2 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 May 2024 00:19:09 +0200 Subject: [PATCH] Fix libafl_sugar docs build (#2188) * Fix libafl_sugar docs build * doc redoc * fmt --- libafl_sugar/Cargo.toml | 39 ++++++++++++++++++++++++++++----------- libafl_sugar/src/lib.rs | 5 +++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/libafl_sugar/Cargo.toml b/libafl_sugar/Cargo.toml index 15d0e8a6a1..3f71d4758d 100644 --- a/libafl_sugar/Cargo.toml +++ b/libafl_sugar/Cargo.toml @@ -16,18 +16,33 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s all-features = true [features] -python = ["pyo3", "libafl_qemu/python", "pyo3-build-config"] default = [] +document-features = ["dep:document-features"] +clippy = [ "libafl_qemu/clippy" ] # special feature for clippy, don't use in normal projects + +#! # Feature Flags +#! ## General Features + +## Build python bindings +python = ["pyo3", "libafl_qemu/python", "pyo3-build-config"] -# for libafl_qemu -# The following architecture features are mutually exclusive. -x86_64 = ["libafl_qemu/x86_64"] # build qemu for x86_64 (default) -i386 = ["libafl_qemu/i386"] # build qemu for i386 -arm = ["libafl_qemu/arm"] # build qemu for arm -aarch64 = ["libafl_qemu/aarch64"] # build qemu for aarch64 -mips = ["libafl_qemu/mips"] # build qemu for mips (el, use with the 'be' feature of mips be) -ppc = ["libafl_qemu/ppc"] # build qemu for powerpc -hexagon = ["libafl_qemu/hexagon"] # build qemu for hexagon +#! ## Features for `libafl_qemu` (Linux only) +#! The following architecture features are mutually exclusive. + +## build qemu for x86_64 (default) +x86_64 = ["libafl_qemu/x86_64"] +## build qemu for i386 +i386 = ["libafl_qemu/i386"] +## build qemu for arm +arm = ["libafl_qemu/arm"] +## build qemu for aarch64 +aarch64 = ["libafl_qemu/aarch64"] +## build qemu for mips (el, use with the 'be' feature of mips be) +mips = ["libafl_qemu/mips"] +## build qemu for powerpc +ppc = ["libafl_qemu/ppc"] +## build qemu for hexagon +hexagon = ["libafl_qemu/hexagon"] [build-dependencies] pyo3-build-config = { version = "0.18", optional = true } @@ -37,6 +52,9 @@ libafl = { path = "../libafl", version = "0.12.0", features = ["adaptive_seriali libafl_bolts = { path = "../libafl_bolts", version = "0.12.0" } libafl_targets = { path = "../libafl_targets", version = "0.12.0" } +# Document all features of this crate (for `cargo doc`) +document-features = { version = "0.2", optional = true } + typed-builder = "0.18" # Implement the builder pattern at compiletime pyo3 = { version = "0.18", optional = true } log = "0.4.20" @@ -47,4 +65,3 @@ libafl_qemu = { path = "../libafl_qemu", version = "0.12.0" } [lib] name = "libafl_sugar" crate-type = ["cdylib", "rlib"] - diff --git a/libafl_sugar/src/lib.rs b/libafl_sugar/src/lib.rs index 5535bca62f..459562a437 100644 --- a/libafl_sugar/src/lib.rs +++ b/libafl_sugar/src/lib.rs @@ -1,5 +1,6 @@ -//! Sugar API to simplify the life of the naive user of `LibAFL` - +//! Sugar API to simplify the life of users of `LibAFL` that just want to fuzz. +/*! */ +#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] #![deny(rustdoc::broken_intra_doc_links)] #![deny(clippy::all)] #![deny(clippy::pedantic)]