From 7193c2274d586207f83210f13ebc66ac8085c57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= Date: Mon, 20 Nov 2023 20:57:08 +0800 Subject: [PATCH 1/4] feat(compio): add some features for monocrate --- Cargo.toml | 2 +- compio/Cargo.toml | 19 +++++++++++++++---- compio/src/lib.rs | 6 ++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cc3888d0..09ad52e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ compio-net = { path = "./compio-net", version = "0.2.0-beta.1" } compio-signal = { path = "./compio-signal", version = "0.1.1-beta.1" } compio-dispatcher = { path = "./compio-dispatcher", version = "0.1.0-beta.1" } compio-log = { path = "./compio-log", version = "0.1.0-beta.1" } -compio-tls = { path = "./compio-tls", version = "0.1.0-beta.1" } +compio-tls = { path = "./compio-tls", version = "0.1.0-beta.1", default-features = false } cfg-if = "1.0.0" criterion = "0.5.1" diff --git a/compio/Cargo.toml b/compio/Cargo.toml index b74a1bda..27325051 100644 --- a/compio/Cargo.toml +++ b/compio/Cargo.toml @@ -39,7 +39,7 @@ compio-io = { workspace = true, optional = true } compio-net = { workspace = true } compio-signal = { workspace = true, optional = true } compio-dispatcher = { workspace = true, optional = true } -compio-log = { workspace = true, optional = true } +compio-log = { workspace = true } compio-tls = { workspace = true, optional = true } # Shared dev dependencies for all platforms @@ -74,6 +74,7 @@ default = ["runtime", "io-uring"] io-uring = ["compio-driver/io-uring"] polling = ["compio-driver/polling"] io = ["dep:compio-io"] +io-compat = ["io", "compio-io/compat"] runtime = [ "dep:compio-runtime", "compio-fs/runtime", @@ -86,10 +87,17 @@ signal = ["dep:compio-signal", "event"] time = ["compio-runtime/time", "runtime"] dispatcher = ["dep:compio-dispatcher", "runtime"] tls = ["dep:compio-tls"] -all = ["time", "macros", "signal", "dispatcher", "tls"] +native-tls = ["tls", "compio-tls/native-tls"] +rustls = ["tls", "compio-tls/rustls"] +all = ["time", "macros", "signal", "dispatcher", "native-tls", "rustls"] +arrayvec = ["compio-buf/arrayvec"] +bumpalo = ["compio-buf/bumpalo"] +bytes = ["compio-buf/bytes"] criterion = ["compio-runtime?/criterion"] +enable_log = ["compio-log/enable_log"] + # Nightly features allocator_api = ["compio-buf/allocator_api", "compio-io?/allocator_api"] lazy_cell = ["compio-signal?/lazy_cell"] @@ -98,9 +106,12 @@ once_cell_try = [ "compio-runtime?/once_cell_try", "compio-signal?/once_cell_try", ] -read_buf = ["compio-buf/read_buf", "compio-io?/read_buf"] +read_buf = [ + "compio-buf/read_buf", + "compio-io?/read_buf", + "compio-tls?/read_buf", +] try_trait_v2 = ["compio-buf/try_trait_v2"] -enable_log = ["compio-log/enable_log"] nightly = [ "allocator_api", "lazy_cell", diff --git a/compio/src/lib.rs b/compio/src/lib.rs index 01a375d6..e3c30bb3 100644 --- a/compio/src/lib.rs +++ b/compio/src/lib.rs @@ -22,6 +22,12 @@ #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![warn(missing_docs)] +#[cfg(feature = "arrayvec")] +pub use buf::arrayvec; +#[cfg(feature = "bumpalo")] +pub use buf::bumpalo; +#[cfg(feature = "bytes")] +pub use buf::bytes; #[doc(no_inline)] pub use buf::BufResult; #[cfg(feature = "dispatcher")] From dc0da038deb352e02d8d3efe8ba82873f4726dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= Date: Wed, 22 Nov 2023 00:30:31 +0800 Subject: [PATCH 2/4] fix(dependencies): remove unused workspace dependencies --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 09ad52e6..43fd6ba4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,6 @@ nix = "0.27.1" once_cell = "1.18.0" os_pipe = "1.1.4" paste = "1.0.14" -send_wrapper = "0.6" slab = "0.4.9" socket2 = "0.5.5" tempfile = "3.8.1" @@ -57,5 +56,3 @@ windows-sys = "0.48.0" native-tls = "0.2.11" rustls = "0.22.0-alpha.4" rustls-native-certs = "0.7.0-alpha.1" - -hyper = "0.14" From 4d07e98ff0f17f9de2b2faa08f62c9caf57a10c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= Date: Wed, 22 Nov 2023 22:35:48 +0800 Subject: [PATCH 3/4] feat(tls,lib): reexport native-tls and rustls --- Cargo.toml | 4 ---- compio-tls/Cargo.toml | 6 +++--- compio-tls/src/lib.rs | 5 +++++ compio/src/lib.rs | 4 ++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 43fd6ba4..78e8500a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,3 @@ tempfile = "3.8.1" tokio = "1.33.0" widestring = "1.0.2" windows-sys = "0.48.0" - -native-tls = "0.2.11" -rustls = "0.22.0-alpha.4" -rustls-native-certs = "0.7.0-alpha.1" diff --git a/compio-tls/Cargo.toml b/compio-tls/Cargo.toml index 3a736059..d1fff395 100644 --- a/compio-tls/Cargo.toml +++ b/compio-tls/Cargo.toml @@ -18,15 +18,15 @@ rustdoc-args = ["--cfg", "docsrs"] compio-buf = { workspace = true } compio-io = { workspace = true, features = ["compat"] } -native-tls = { workspace = true, optional = true } -rustls = { workspace = true, optional = true } +native-tls = { version = "0.2.11", optional = true } +rustls = { version = "0.22.0-alpha.4", optional = true } [dev-dependencies] compio-net = { workspace = true } compio-runtime = { workspace = true } compio-macros = { workspace = true } -rustls-native-certs = { workspace = true } +rustls-native-certs = "0.7.0-alpha.1" [features] default = ["native-tls"] diff --git a/compio-tls/src/lib.rs b/compio-tls/src/lib.rs index 1c9dd16d..ecf5e5c8 100644 --- a/compio-tls/src/lib.rs +++ b/compio-tls/src/lib.rs @@ -4,6 +4,11 @@ #![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#[cfg(feature = "native-tls")] +pub use native_tls; +#[cfg(feature = "rustls")] +pub use rustls; + mod adapter; mod stream; diff --git a/compio/src/lib.rs b/compio/src/lib.rs index e3c30bb3..ec3d3ea7 100644 --- a/compio/src/lib.rs +++ b/compio/src/lib.rs @@ -53,5 +53,9 @@ pub use runtime::event; #[cfg(feature = "time")] #[doc(no_inline)] pub use runtime::time; +#[cfg(feature = "native-tls")] +pub use tls::native_tls; +#[cfg(feature = "rustls")] +pub use tls::rustls; #[doc(inline)] pub use {compio_buf as buf, compio_driver as driver, compio_fs as fs, compio_net as net}; From 57dc96840dbc24cad7000472c11ecc6039b6be36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= Date: Wed, 22 Nov 2023 22:36:05 +0800 Subject: [PATCH 4/4] feat(tls,lib): update version --- compio-tls/Cargo.toml | 2 +- compio/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compio-tls/Cargo.toml b/compio-tls/Cargo.toml index d1fff395..cd0ad9c0 100644 --- a/compio-tls/Cargo.toml +++ b/compio-tls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "compio-tls" -version = "0.1.0-beta.1" +version = "0.1.0-beta.2" description = "TLS adaptor with compio" categories = ["asynchronous", "network-programming"] keywords = ["async", "net", "tls"] diff --git a/compio/Cargo.toml b/compio/Cargo.toml index 27325051..e69d75e7 100644 --- a/compio/Cargo.toml +++ b/compio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "compio" -version = "0.9.0-beta.2" +version = "0.9.0-beta.3" description = "completion based async runtime" categories = ["asynchronous", "filesystem", "network-programming"] keywords = ["async", "fs", "iocp", "io-uring", "net"]