From 04547086093d9989c02831881565fcdad801c496 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Wed, 27 Nov 2024 13:30:26 +0100 Subject: [PATCH] cleanup dependencies and features --- Cargo.lock | 130 +------------------------------------- iroh-net/Cargo.toml | 3 - iroh/Cargo.toml | 69 +++++++------------- iroh/examples/transfer.rs | 5 +- 4 files changed, 26 insertions(+), 181 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b80a47dc9e..7e8ab568634 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,18 +190,6 @@ dependencies = [ "syn 2.0.89", ] -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-recursion" version = "1.1.1" @@ -391,15 +379,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -1347,27 +1326,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -2446,40 +2404,17 @@ name = "iroh" version = "0.28.1" dependencies = [ "anyhow", - "async-channel", "bytes", - "cc", "clap", - "derive_more", "futures-lite 2.5.0", - "futures-util", "indicatif", "iroh-base", - "iroh-io", - "iroh-metrics", "iroh-net", - "iroh-node-util", - "iroh-quinn", - "iroh-relay", "iroh-router", - "nested_enum_utils", - "num_cpus", - "parking_lot", "parse-size", - "postcard", - "quic-rpc", - "quic-rpc-derive", - "ref-cast", - "serde", - "serde-error", - "strum", - "tempfile", - "thiserror 2.0.3", "tokio", - "tokio-util", "tracing", "tracing-subscriber", - "url", ] [[package]] @@ -2574,19 +2509,6 @@ dependencies = [ "z32", ] -[[package]] -name = "iroh-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e302c5ad649c6a7aa9ae8468e1c4dc2469321af0c6de7341c1be1bdaab434b" -dependencies = [ - "bytes", - "futures-lite 2.5.0", - "pin-project", - "smallvec", - "tokio", -] - [[package]] name = "iroh-metrics" version = "0.28.0" @@ -2621,7 +2543,6 @@ dependencies = [ "crypto_box", "der", "derive_more", - "duct", "futures-buffered", "futures-concurrency", "futures-lite 2.5.0", @@ -3500,16 +3421,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - [[package]] name = "num_enum" version = "0.7.3" @@ -4166,7 +4077,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc623a188942fc875926f7baeb2cb08ed4288b64f29072656eb051e360ee7623" dependencies = [ "anyhow", - "bincode", "derive_more", "educe", "flume", @@ -4174,12 +4084,10 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "iroh-quinn", "pin-project", "serde", "slab", "tokio", - "tokio-serde", "tokio-util", "tracing", ] @@ -4393,26 +4301,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "ref-cast" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "regex" version = "1.11.1" @@ -5598,21 +5486,6 @@ dependencies = [ "x509-parser", ] -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", -] - [[package]] name = "tokio-stream" version = "0.1.16" @@ -5678,7 +5551,6 @@ dependencies = [ "futures-util", "hashbrown 0.14.5", "pin-project-lite", - "slab", "tokio", ] @@ -6182,7 +6054,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45b42a2f611916b5965120a9cde2b60f2db4454826dd9ad5e6f47c24a5b3b259" dependencies = [ - "event-listener 4.0.3", + "event-listener", "futures-util", "parking_lot", "thiserror 1.0.69", diff --git a/iroh-net/Cargo.toml b/iroh-net/Cargo.toml index 136545c5df0..bbdffb229e3 100644 --- a/iroh-net/Cargo.toml +++ b/iroh-net/Cargo.toml @@ -174,9 +174,6 @@ iroh-relay = { version = "0.28", path = "../iroh-relay", features = ["test-utils name = "key" harness = false -[build-dependencies] -duct = "0.13.6" - [features] default = ["metrics", "discovery-pkarr-dht"] metrics = ["iroh-metrics/metrics"] diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml index 70713c7dee1..f99b94b889d 100644 --- a/iroh/Cargo.toml +++ b/iroh/Cargo.toml @@ -16,64 +16,39 @@ rust-version = "1.76" workspace = true [dependencies] -cc = "=1.1.31" # enforce cc version, because of https://github.com/rust-lang/cc-rs/issues/1278 -anyhow = { version = "1" } -async-channel = "2.3.1" -bytes = "1.7" -derive_more = { version = "1.0.0", features = [ - "debug", - "display", - "from", - "try_into", - "from_str", -] } -futures-lite = "2.5" -futures-util = "0.3" iroh-base = { version = "0.28.0", features = ["key"] } -iroh-io = { version = "0.6.0", features = ["stats"] } -iroh-metrics = { version = "0.28.0", optional = true } -iroh-net = { version = "0.28.1", features = ["discovery-local-network"] } -iroh-node-util = { version = "0.28.0", path = "../iroh-node-util" } +iroh-net = { version = "0.28.1", default-features = false } iroh-router = { version = "0.28.0" } -nested_enum_utils = "0.1.0" -num_cpus = { version = "1.15.0" } -parking_lot = "0.12.1" -postcard = { version = "1", default-features = false, features = [ - "alloc", - "use-std", - "experimental-derive", -] } -quic-rpc = { version = "0.15", default-features = false, features = [ - "flume-transport", - "quinn-transport", -] } -quic-rpc-derive = { version = "0.15" } -quinn = { package = "iroh-quinn", version = "0.12" } -serde = { version = "1", features = ["derive"] } -strum = { version = "0.26", features = ["derive"] } -thiserror = "2" -tempfile = "3.4" -tokio = { version = "1", features = ["io-util", "rt"] } -tokio-util = { version = "0.7", features = ["codec", "io-util", "io", "time"] } -tracing = "0.1" -iroh-relay = { version = "0.28", path = "../iroh-relay" } -ref-cast = "1.0.23" # Examples +anyhow = { version = "1", optional = true } clap = { version = "4", features = ["derive"], optional = true } indicatif = { version = "0.17", features = ["tokio"], optional = true } parse-size = { version = "=1.0.0", optional = true } # pinned version to avoid bumping msrv to 1.81 +tokio = { version = "1", features = ["full"], optional = true } tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true } +futures-lite = { version = "2.5.0", optional = true } +tracing = { version = "0.1.40", optional = true } +bytes = { version = "1.8.0", optional = true } -# Documentation tests -url = { version = "2.5", features = ["serde"] } -serde-error = "0.1.3" [features] -default = [] - -examples = ["dep:clap", "dep:indicatif", "dep:parse-size", "dep:tracing-subscriber"] - +default = ["metrics", "discovery-pkarr-dht"] +metrics = ["iroh-net/metrics"] +discovery-local-network = ["iroh-net/discovery-local-network"] +discovery-pkarr-dht = ["iroh-net/discovery-pkarr-dht"] + +examples = [ + "dep:anyhow", + "dep:clap", + "dep:indicatif", + "dep:parse-size", + "dep:tokio", + "dep:tracing-subscriber", + "dep:futures-lite", + "dep:tracing", + "dep:bytes", +] [package.metadata.docs.rs] all-features = true diff --git a/iroh/examples/transfer.rs b/iroh/examples/transfer.rs index 4a9025cb1c5..c1ca5c90e23 100644 --- a/iroh/examples/transfer.rs +++ b/iroh/examples/transfer.rs @@ -9,7 +9,8 @@ use clap::{Parser, Subcommand}; use futures_lite::StreamExt; use indicatif::HumanBytes; use iroh_net::{ - key::SecretKey, ticket::NodeTicket, Endpoint, NodeAddr, RelayMap, RelayMode, RelayUrl, + endpoint::ConnectionError, key::SecretKey, ticket::NodeTicket, Endpoint, NodeAddr, RelayMap, + RelayMode, RelayUrl, }; use tracing::info; @@ -132,7 +133,7 @@ async fn provide(size: u64, relay_url: Option) -> anyhow::Result<()> { // it received this message. let res = tokio::time::timeout(Duration::from_secs(3), async move { let closed = conn.closed().await; - if !matches!(closed, quinn::ConnectionError::ApplicationClosed(_)) { + if !matches!(closed, ConnectionError::ApplicationClosed(_)) { println!("node {node_id} disconnected with an error: {closed:#}"); } })