Fix cargo doc on windows (#762)

* add doc cfg

* fix nostd docs

* ignore CommandConfigurator doc test execution on non-unix platform

* add cargo doc step pipeline on windows platform
This commit is contained in:
Vincent 2022-09-04 16:34:26 +09:00 committed by GitHub
parent d316591ba1
commit 10f5c0f07a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -213,6 +213,8 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: clippy command: clippy
- name: Build docs
run: cargo doc
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 - name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd
with: with:

View File

@ -593,7 +593,8 @@ impl CommandExecutorBuilder {
/// A `CommandConfigurator` takes care of creating and spawning a [`std::process::Command`] for the [`CommandExecutor`]. /// A `CommandConfigurator` takes care of creating and spawning a [`std::process::Command`] for the [`CommandExecutor`].
/// # Example /// # Example
/// ``` #[cfg_attr(all(feature = "std", unix), doc = " ```")]
#[cfg_attr(not(all(feature = "std", unix)), doc = " ```ignore")]
/// use std::{io::Write, process::{Stdio, Command, Child}}; /// use std::{io::Write, process::{Stdio, Command, Child}};
/// use libafl::{Error, bolts::AsSlice, inputs::{Input, HasTargetBytes}, executors::{Executor, command::CommandConfigurator}}; /// use libafl::{Error, bolts::AsSlice, inputs::{Input, HasTargetBytes}, executors::{Executor, command::CommandConfigurator}};
/// #[derive(Debug)] /// #[derive(Debug)]
@ -621,7 +622,7 @@ impl CommandExecutorBuilder {
/// MyExecutor.into_executor(()) /// MyExecutor.into_executor(())
/// } /// }
/// ``` /// ```
#[cfg(all(feature = "std", unix))] #[cfg(all(feature = "std", any(unix, doc)))]
pub trait CommandConfigurator: Sized + Debug { pub trait CommandConfigurator: Sized + Debug {
/// Spawns a new process with the given configuration. /// Spawns a new process with the given configuration.
fn spawn_child<I>(&mut self, input: &I) -> Result<Child, Error> fn spawn_child<I>(&mut self, input: &I) -> Result<Child, Error>

View File

@ -29,11 +29,11 @@ pub use shadow::ShadowExecutor;
pub mod with_observers; pub mod with_observers;
pub use with_observers::WithObservers; pub use with_observers::WithObservers;
#[cfg(all(feature = "std", unix))] #[cfg(all(feature = "std", any(unix, doc)))]
pub mod command; pub mod command;
use core::fmt::Debug; use core::fmt::Debug;
#[cfg(all(feature = "std", unix))] #[cfg(all(feature = "std", any(unix, doc)))]
pub use command::CommandExecutor; pub use command::CommandExecutor;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};