Fix docs build for libafl_qemu (#1495)

* Fix docs build for libafl_qemu

* turn around

* does this work?

* build all-features in CI

* fixes

* fix ci
This commit is contained in:
Dominik Maier 2023-09-02 21:56:01 +02:00 committed by GitHub
parent 7e5a1dba05
commit f27107c5e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 10 deletions

View File

@ -91,10 +91,9 @@ jobs:
# ---- doc check ---- # ---- doc check ----
- name: Build Docs - name: Build Docs
run: cargo +nightly doc --all-features run: RUSTFLAGS="--cfg docsrs" cargo +nightly doc --all-features
- name: Test Docs - name: Test Docs
run: cargo +nightly test --doc --all-features run: RUSTFLAGS="--cfg docsrs" cargo +nightly test --doc --all-features
# ---- build normal and examples ---- # ---- build normal and examples ----
- name: Run a normal build - name: Run a normal build
run: cargo build --verbose run: cargo build --verbose

View File

@ -5,8 +5,7 @@ macro_rules! assert_unique_feature {
() => {}; () => {};
($first:tt $(,$rest:tt)*) => { ($first:tt $(,$rest:tt)*) => {
$( $(
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy #[cfg(all(not(any(doc, feature = "clippy")), feature = $first, feature = $rest))]
#[cfg(all(feature = $first, feature = $rest))]
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together")); compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
)* )*
assert_unique_feature!($($rest),*); assert_unique_feature!($($rest),*);

View File

@ -5,8 +5,7 @@ macro_rules! assert_unique_feature {
() => {}; () => {};
($first:tt $(,$rest:tt)*) => { ($first:tt $(,$rest:tt)*) => {
$( $(
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy #[cfg(all(not(any(doc, feature = "clippy")), feature = $first, feature = $rest))]
#[cfg(all(feature = $first, feature = $rest))]
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together")); compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
)* )*
assert_unique_feature!($($rest),*); assert_unique_feature!($($rest),*);

View File

@ -14,6 +14,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = ["document-features"] features = ["document-features"]
all-features = true all-features = true
rustc-args = ["--cfg", "docsrs"]
[features] [features]
default = ["std", "derive", "llmp_compression", "llmp_small_maps", "llmp_broker_timeouts", "rand_trait", "fork", "prelude", "gzip", "regex", "serdeany_autoreg", "tui_monitor", "libafl_bolts/xxh3"] default = ["std", "derive", "llmp_compression", "llmp_small_maps", "llmp_broker_timeouts", "rand_trait", "fork", "prelude", "gzip", "regex", "serdeany_autoreg", "tui_monitor", "libafl_bolts/xxh3"]

View File

@ -8,7 +8,7 @@ fn main() {
fn main() { fn main() {
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
assert!( assert!(
cfg!(not(feature = "nautilus")), cfg!(all(not(docrs), not(feature = "nautilus"))),
"The 'nautilus' feature of libafl requires a nightly compiler" "The 'nautilus' feature of libafl requires a nightly compiler"
); );
} }

View File

@ -13,6 +13,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[features] [features]
default = ["fork", "build_libqasan", "serdeany_autoreg"] default = ["fork", "build_libqasan", "serdeany_autoreg"]

View File

@ -13,6 +13,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[features] [features]
# The following architecture features are mutually exclusive. # The following architecture features are mutually exclusive.

View File

@ -7,8 +7,7 @@ macro_rules! assert_unique_feature {
() => {}; () => {};
($first:tt $(,$rest:tt)*) => { ($first:tt $(,$rest:tt)*) => {
$( $(
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy #[cfg(all(not(any(docsrs, feature = "clippy")), feature = $first, feature = $rest))]
#[cfg(all(feature = $first, feature = $rest))]
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together")); compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
)* )*
assert_unique_feature!($($rest),*); assert_unique_feature!($($rest),*);