Skip to content

Commit f27107c

Browse files
authored
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
1 parent 7e5a1db commit f27107c

File tree

8 files changed

+9
-10
lines changed

8 files changed

+9
-10
lines changed

.github/workflows/build_and_test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ jobs:
9191

9292
# ---- doc check ----
9393
- name: Build Docs
94-
run: cargo +nightly doc --all-features
94+
run: RUSTFLAGS="--cfg docsrs" cargo +nightly doc --all-features
9595
- name: Test Docs
96-
run: cargo +nightly test --doc --all-features
97-
96+
run: RUSTFLAGS="--cfg docsrs" cargo +nightly test --doc --all-features
9897
# ---- build normal and examples ----
9998
- name: Run a normal build
10099
run: cargo build --verbose

fuzzers/qemu_coverage/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ macro_rules! assert_unique_feature {
55
() => {};
66
($first:tt $(,$rest:tt)*) => {
77
$(
8-
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy
9-
#[cfg(all(feature = $first, feature = $rest))]
8+
#[cfg(all(not(any(doc, feature = "clippy")), feature = $first, feature = $rest))]
109
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
1110
)*
1211
assert_unique_feature!($($rest),*);

fuzzers/qemu_launcher/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ macro_rules! assert_unique_feature {
55
() => {};
66
($first:tt $(,$rest:tt)*) => {
77
$(
8-
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy
9-
#[cfg(all(feature = $first, feature = $rest))]
8+
#[cfg(all(not(any(doc, feature = "clippy")), feature = $first, feature = $rest))]
109
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
1110
)*
1211
assert_unique_feature!($($rest),*);

libafl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
1414
[package.metadata.docs.rs]
1515
features = ["document-features"]
1616
all-features = true
17+
rustc-args = ["--cfg", "docsrs"]
1718

1819
[features]
1920
default = ["std", "derive", "llmp_compression", "llmp_small_maps", "llmp_broker_timeouts", "rand_trait", "fork", "prelude", "gzip", "regex", "serdeany_autoreg", "tui_monitor", "libafl_bolts/xxh3"]

libafl/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
fn main() {
99
println!("cargo:rerun-if-changed=build.rs");
1010
assert!(
11-
cfg!(not(feature = "nautilus")),
11+
cfg!(all(not(docrs), not(feature = "nautilus"))),
1212
"The 'nautilus' feature of libafl requires a nightly compiler"
1313
);
1414
}

libafl_qemu/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
1313

1414
[package.metadata.docs.rs]
1515
all-features = true
16+
rustdoc-args = ["--cfg", "docsrs"]
1617

1718
[features]
1819
default = ["fork", "build_libqasan", "serdeany_autoreg"]

libafl_qemu/libafl_qemu_sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s
1313

1414
[package.metadata.docs.rs]
1515
all-features = true
16+
rustdoc-args = ["--cfg", "docsrs"]
1617

1718
[features]
1819
# The following architecture features are mutually exclusive.

libafl_qemu/libafl_qemu_sys/build_linux.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ macro_rules! assert_unique_feature {
77
() => {};
88
($first:tt $(,$rest:tt)*) => {
99
$(
10-
#[cfg(not(feature = "clippy"))] // ignore multiple definition for clippy
11-
#[cfg(all(feature = $first, feature = $rest))]
10+
#[cfg(all(not(any(docsrs, feature = "clippy")), feature = $first, feature = $rest))]
1211
compile_error!(concat!("features \"", $first, "\" and \"", $rest, "\" cannot be used together"));
1312
)*
1413
assert_unique_feature!($($rest),*);

0 commit comments

Comments
 (0)