Skip to content

Commit

Permalink
deps: promote tokio to workspace dependency
Browse files Browse the repository at this point in the history
Promote `tokio` to workspace dependency.

Pull-Request: #5251.
  • Loading branch information
drHuangMHT committed Apr 15, 2024
1 parent c504eef commit bee8199
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 35 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ quick-protobuf-codec = { version = "0.3.1", path = "misc/quick-protobuf-codec" }
quickcheck = { package = "quickcheck-ext", path = "misc/quickcheck-ext" }
rw-stream-sink = { version = "0.4.0", path = "misc/rw-stream-sink" }
unsigned-varint = { version = "0.8.0" }
tokio = { version = "1.37", default-features = false }
tracing = "0.1.37"

[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion examples/autonat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
release = false

[dependencies]
tokio = { version = "1.37", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
clap = { version = "4.5.4", features = ["derive"] }
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = ["tokio", "tcp", "noise", "yamux", "autonat", "identify", "macros"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-webrtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ axum = "0.7.5"
libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "tokio"] }
libp2p-webrtc = { workspace = true, features = ["tokio"] }
rust-embed = { version = "8.3.0", features = ["include-exclude", "interpolate-folder-path"] }
tokio = { version = "1.37", features = ["macros", "net", "rt", "signal"] }
tokio = { workspace = true, features = ["macros", "net", "rt", "signal"] }
tokio-util = { version = "0.7", features = ["compat"] }
tower = "0.4"
tower-http = { version = "0.5.2", features = ["cors"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
release = false

[dependencies]
tokio = { version = "1.37", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
async-trait = "0.1"
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = [ "tokio", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ futures = "0.3.30"
futures-timer = "3.0"
libp2p = { path = "../../libp2p", features = [ "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
log = "0.4"
tokio = { version = "1.37", features = ["macros", "net", "rt", "signal"] }
tokio = { workspace = true, features = ["macros", "net", "rt", "signal"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/file-sharing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ release = false

[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
clap = { version = "4.5.4", features = ["derive"] }
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = [ "tokio", "cbor", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-kad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
release = false

[dependencies]
tokio = { version = "1.37", features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
async-trait = "0.1"
clap = { version = "4.5.4", features = ["derive"] }
env_logger = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-private/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
release = false

[dependencies]
tokio = { version = "1.37", features = ["rt-multi-thread", "macros", "io-std"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "io-std"] }
async-trait = "0.1"
either = "1.9"
futures = "0.3.30"
Expand Down
2 changes: 1 addition & 1 deletion examples/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ opentelemetry = { version = "0.22.0", features = ["metrics"] }
opentelemetry-otlp = { version = "0.15.0", features = ["metrics"] }
opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio", "metrics"] }
prometheus-client = { workspace = true }
tokio = { version = "1", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }
tracing-opentelemetry = "0.23.0"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/ping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ release = false
[dependencies]
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = ["noise", "ping", "tcp", "tokio", "yamux"] }
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/rendezvous/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = [ "async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
tokio = { version = "1.37", features = ["rt-multi-thread", "macros", "time"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "time"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ futures = "0.3.29"
libp2p = { path = "../../libp2p", features = [ "tokio", "quic"] }
libp2p-stream = { path = "../../protocols/stream", version = "0.1.0-alpha" }
rand = "0.8"
tokio = { version = "1.37", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/upnp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
release = false

[dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
futures = "0.3.30"
libp2p = { path = "../../libp2p", features = ["tokio", "dns", "macros", "noise", "ping", "tcp", "yamux", "upnp"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down
2 changes: 1 addition & 1 deletion hole-punching-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ futures = "0.3.30"
libp2p = { path = "../libp2p", features = ["tokio", "dcutr", "identify", "macros", "noise", "ping", "relay", "tcp", "yamux", "quic"] }
tracing = { workspace = true }
redis = { version = "0.23.0", default-features = false, features = ["tokio-comp"] }
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
either = "1.9.0"
2 changes: 1 addition & 1 deletion interop-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ redis = { version = "0.23.3", default-features = false, features = [
rust-embed = "8.3"
serde_json = "1"
thirtyfour = "=0.32.0" # https://github.com/stevepryde/thirtyfour/issues/169
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tower-http = { version = "0.5", features = ["cors", "fs", "trace"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down
2 changes: 1 addition & 1 deletion libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ libp2p-websocket = { workspace = true, optional = true }
async-std = { version = "1.6.2", features = ["attributes"] }
async-trait = "0.1"
clap = { version = "4.1.6", features = ["derive"] }
tokio = { version = "1.15", features = [ "io-util", "io-std", "macros", "rt", "rt-multi-thread"] }
tokio = { workspace = true, features = [ "io-util", "io-std", "macros", "rt", "rt-multi-thread"] }

libp2p-mplex = { workspace = true }
libp2p-noise = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion misc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ prometheus-client = { workspace = true }
serde = "1.0.197"
serde_derive = "1.0.125"
serde_json = "1.0"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
zeroize = "1"
Expand Down
4 changes: 2 additions & 2 deletions protocols/mdns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ libp2p-identity = { workspace = true }
rand = "0.8.3"
smallvec = "1.13.2"
socket2 = { version = "0.5.6", features = ["all"] }
tokio = { version = "1.37", default-features = false, features = ["net", "time"], optional = true}
tokio = { workspace = true, default-features = false, features = ["net", "time"], optional = true}
tracing = { workspace = true }
hickory-proto = { version = "0.24.0", default-features = false, features = ["mdns"] }
void = "1.0.2"
Expand All @@ -37,7 +37,7 @@ libp2p-noise = { workspace = true }
libp2p-swarm = { workspace = true, features = ["tokio", "async-std"] }
libp2p-tcp = { workspace = true, features = ["tokio", "async-io"] }
libp2p-yamux = { workspace = true }
tokio = { version = "1.37", default-features = false, features = ["macros", "rt", "rt-multi-thread", "time"] }
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "time"] }
libp2p-swarm-test = { path = "../../swarm-test" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion protocols/perf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde_json = "1.0"
thiserror = "1.0"
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1.37", default-features = false, features = ["macros", "rt", "rt-multi-thread"] }
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }
void = "1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion protocols/rendezvous/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ libp2p-swarm-test = { path = "../../swarm-test" }
libp2p-tcp = { workspace = true, features = ["tokio"] }
libp2p-yamux = { workspace = true }
rand = "0.8"
tokio = { version = "1.37", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }
tokio = { workspace = true, features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Passing arguments to the docsrs builder in order to properly document cfg's.
Expand Down
2 changes: 1 addition & 1 deletion protocols/stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rand = "0.8"

[dev-dependencies]
libp2p-swarm-test = { workspace = true }
tokio = { version = "1", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[lints]
Expand Down
2 changes: 1 addition & 1 deletion protocols/upnp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ futures-timer = "3.0.3"
igd-next = "0.14.3"
libp2p-core = { workspace = true }
libp2p-swarm = { workspace = true }
tokio = { version = "1.37", default-features = false, features = ["rt"], optional = true }
tokio = { workspace = true, default-features = false, features = ["rt"], optional = true }
tracing = { workspace = true }
void = "1.0.2"

Expand Down
4 changes: 2 additions & 2 deletions swarm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ wasm-bindgen-futures = { version = "0.4.42", optional = true }

[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
async-std = { version = "1.6.2", optional = true }
tokio = { version = "1.37", features = ["rt"], optional = true }
tokio = { workspace = true, features = ["rt"], optional = true }

[features]
macros = ["dep:libp2p-swarm-derive"]
Expand All @@ -55,7 +55,7 @@ quickcheck = { workspace = true }
void = "1"
once_cell = "1.19.0"
trybuild = "1.0.91"
tokio = { version = "1.37.0", features = ["time", "rt", "macros", "rt-multi-thread"] }
tokio = { workspace = true, features = ["time", "rt", "macros", "rt-multi-thread"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[[test]]
Expand Down
2 changes: 1 addition & 1 deletion transports/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tracing = { workspace = true }

[dev-dependencies]
libp2p-identity = { workspace = true, features = ["rand"] }
tokio-crate = { package = "tokio", version = "1.0", default-features = false, features = ["rt", "time"] }
tokio = { workspace = true, features = ["rt", "time"] }
async-std-crate = { package = "async-std", version = "1.6" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion transports/dns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ mod tests {
// type record lookups may not work with the system DNS resolver.
let config = ResolverConfig::quad9();
let opts = ResolverOpts::default();
let rt = tokio_crate::runtime::Builder::new_current_thread()
let rt = ::tokio::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()
Expand Down
2 changes: 1 addition & 1 deletion transports/pnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ libp2p-tcp = { workspace = true, features = ["tokio"] }
libp2p-websocket = { workspace = true }
libp2p-yamux = { workspace = true }
quickcheck = { workspace = true }
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
Expand Down
4 changes: 2 additions & 2 deletions transports/quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ quinn = { version = "0.10.2", default-features = false, features = ["tls-rustls"
rand = "0.8.5"
rustls = { version = "0.21.9", default-features = false }
thiserror = "1.0.58"
tokio = { version = "1.37.0", default-features = false, features = ["net", "rt", "time"], optional = true }
tokio = { workspace = true, default-features = false, features = ["net", "rt", "time"], optional = true }
tracing = { workspace = true }
socket2 = "0.5.6"
ring = "0.16.20"
Expand All @@ -46,7 +46,7 @@ libp2p-noise = { workspace = true }
libp2p-tcp = { workspace = true, features = ["async-io"] }
libp2p-yamux = { workspace = true }
quickcheck = "1"
tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread", "time"] }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[[test]]
Expand Down
4 changes: 2 additions & 2 deletions transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ libc = "0.2.153"
libp2p-core = { workspace = true }
libp2p-identity = { workspace = true }
socket2 = { version = "0.5.6", features = ["all"] }
tokio = { version = "1.37.0", default-features = false, features = ["net"], optional = true }
tokio = { workspace = true, default-features = false, features = ["net"], optional = true }
tracing = { workspace = true }

[features]
Expand All @@ -29,7 +29,7 @@ async-io = ["dep:async-io", "if-watch/smol"]
[dev-dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
libp2p-identity = { workspace = true, features = ["rand"] }
tokio = { version = "1.37.0", default-features = false, features = ["full"] }
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Passing arguments to the docsrs builder in order to properly document cfg's.
Expand Down
2 changes: 1 addition & 1 deletion transports/tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ libp2p-core = { workspace = true }
libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "secp256k1", "ecdsa", "rand"] }
libp2p-swarm = { workspace = true, features = ["tokio"] }
libp2p-yamux = { workspace = true }
tokio = { version = "1.37.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
Expand Down
2 changes: 1 addition & 1 deletion transports/uds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
async-std = { version = "1.6.2", optional = true }
libp2p-core = { workspace = true }
futures = "0.3.30"
tokio = { version = "1.37", default-features = false, features = ["net"], optional = true }
tokio = { workspace = true, default-features = false, features = ["net"], optional = true }
tracing = { workspace = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions transports/webrtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde = { version = "1.0", features = ["derive"] }
stun = "0.5"
thiserror = "1"
tinytemplate = "1.2"
tokio = { version = "1.37", features = ["net"], optional = true }
tokio = { workspace = true, features = ["net"], optional = true }
tokio-util = { version = "0.7", features = ["compat"], optional = true }
tracing = { workspace = true }
webrtc = { version = "0.9.0", optional = true }
Expand All @@ -39,7 +39,7 @@ pem = ["webrtc?/pem"]

[dev-dependencies]
libp2p-identity = { workspace = true, features = ["rand"] }
tokio = { version = "1.37", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
quickcheck = "1.0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand Down

0 comments on commit bee8199

Please sign in to comment.