From 1f6bb8b01af18f8180ef36c126f65c379e3b3c11 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 1 Dec 2020 15:51:38 +0100 Subject: [PATCH 1/5] feat: add process module Reexport based on async-process --- Cargo.toml | 4 +++- src/{process/mod.rs => process.rs} | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) rename src/{process/mod.rs => process.rs} (72%) diff --git a/Cargo.toml b/Cargo.toml index eaa2d028b..9fdb7d09a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,8 @@ default = [ docs = ["attributes", "unstable", "default"] unstable = [ "std", - "async-io" + "async-io", + "async-process", ] attributes = ["async-attributes"] std = [ @@ -74,6 +75,7 @@ once_cell = { version = "1.3.1", optional = true } pin-project-lite = { version = "0.2.0", optional = true } pin-utils = { version = "0.1.0-alpha.4", optional = true } slab = { version = "0.4.2", optional = true } +async-process = { version = "1.0.1", optional = true } # Devdepencency, but they are not allowed to be optional :/ surf = { version = "2.0.0", optional = true } diff --git a/src/process/mod.rs b/src/process.rs similarity index 72% rename from src/process/mod.rs rename to src/process.rs index 630c5b9b9..418d2bb36 100644 --- a/src/process/mod.rs +++ b/src/process.rs @@ -7,8 +7,7 @@ //! //! [`std::process`]: https://doc.rust-lang.org/std/process/index.html -// Re-export structs. -pub use std::process::{ExitStatus, Output}; - -// Re-export functions. -pub use std::process::{abort, exit, id}; +#[cfg(feature = "unstable")] +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::*; From 7b896c0bf4f09bde41e03576bdcdd6f924c3af8a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 1 Dec 2020 16:02:00 +0100 Subject: [PATCH 2/5] manual reexports --- src/lib.rs | 2 +- src/os/unix/mod.rs | 5 +++++ src/os/windows/mod.rs | 5 +++++ src/process.rs | 31 +++++++++++++++++++++++++++++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6f97bdcae..dd8fb597d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -313,7 +313,7 @@ cfg_default! { cfg_unstable! { pub mod pin; - #[cfg(not(target_os = "unknown"))] + #[cfg(all(not(target_os = "unknown"), feature = "std"))] pub mod process; mod unit; diff --git a/src/os/unix/mod.rs b/src/os/unix/mod.rs index c389d95a5..36a97967c 100644 --- a/src/os/unix/mod.rs +++ b/src/os/unix/mod.rs @@ -8,3 +8,8 @@ cfg_default! { pub mod fs; pub mod net; } + +#[cfg(all(feature = "unstable", feature = "std"))] +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::unix as process; diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 67bf0372a..11389fb79 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -8,3 +8,8 @@ cfg_unstable! { #[cfg(feature = "default")] pub mod fs; } + +#[cfg(all(feature = "unstable", feature = "std"))] +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::windows as process; diff --git a/src/process.rs b/src/process.rs index 418d2bb36..09b8390ee 100644 --- a/src/process.rs +++ b/src/process.rs @@ -7,7 +7,34 @@ //! //! [`std::process`]: https://doc.rust-lang.org/std/process/index.html -#[cfg(feature = "unstable")] #[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[doc(inline)] -pub use async_process::*; +pub use async_process::ExitStatus; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::Output; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::Stdio; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::Child; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::ChildStderr; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::ChildStdin; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::ChildStdout; + +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] +#[doc(inline)] +pub use async_process::Command; From 151025fa38c98eb519053f7d151054e8f7b14f91 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 1 Dec 2020 16:10:51 +0100 Subject: [PATCH 3/5] fixup --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9fdb7d09a..e6492cdf9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,6 @@ once_cell = { version = "1.3.1", optional = true } pin-project-lite = { version = "0.2.0", optional = true } pin-utils = { version = "0.1.0-alpha.4", optional = true } slab = { version = "0.4.2", optional = true } -async-process = { version = "1.0.1", optional = true } # Devdepencency, but they are not allowed to be optional :/ surf = { version = "2.0.0", optional = true } @@ -85,6 +84,7 @@ async-global-executor = { version = "1.4.0", optional = true, features = ["async async-io = { version = "1.0.1", optional = true } blocking = { version = "1.0.0", optional = true } futures-lite = { version = "1.0.0", optional = true } +async-process = { version = "1.0.1", optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] gloo-timers = { version = "0.2.1", features = ["futures"], optional = true } From 92f5038ed658ac75e7788cadacccaac7dda4430b Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Tue, 8 Dec 2020 22:08:44 +0100 Subject: [PATCH 4/5] attempt to fix docs builds --- src/os/windows/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 11389fb79..8a1aeadd9 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -7,9 +7,6 @@ cfg_std! { cfg_unstable! { #[cfg(feature = "default")] pub mod fs; + #[cfg(feature = "std")] + pub use async_process::windows as process; } - -#[cfg(all(feature = "unstable", feature = "std"))] -#[cfg_attr(feature = "docs", doc(cfg(unstable)))] -#[doc(inline)] -pub use async_process::windows as process; From f8f1eacc9aa8b32a0987b1dd436fd6974d57dc4b Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Tue, 8 Dec 2020 22:40:31 +0100 Subject: [PATCH 5/5] Attempt 2 at fixing docs on windows --- src/os/windows/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 8a1aeadd9..0d45a52e4 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -8,5 +8,6 @@ cfg_unstable! { #[cfg(feature = "default")] pub mod fs; #[cfg(feature = "std")] + #[cfg(windows)] pub use async_process::windows as process; }