Skip to content

Commit

Permalink
chore(rust): remove unused dependencies (#4475)
Browse files Browse the repository at this point in the history
These were all found by `cargo-udeps`.

Resolves: #4403.
  • Loading branch information
thomaseizinger committed Apr 3, 2024
1 parent b668f89 commit 97e6a92
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 87 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
name: "cargo clippy"
shell: bash

- uses: taiki-e/install-action@cargo-udeps
- run: |
rustup install nightly-2024-03-26 --profile minimal # The exact nightly version doesn't matter, just pin a random one.
cargo +nightly-2024-03-26 udeps --all-targets --all-features ${{ steps.setup-rust.outputs.packages }}
name: Check for unused dependencies
test:
name: test-${{ matrix.runs-on }}
strategy:
Expand Down
52 changes: 14 additions & 38 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions rust/client-tunnel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@ edition = "2021"

[dependencies]
anyhow = { version = "1.0" }
secrecy = { workspace = true }
clap = { version = "4.5", features = ["derive", "env"] }
connlib-client-shared = { workspace = true }
connlib-shared = { workspace = true }
firezone-cli-utils = { workspace = true }
humantime = "2.1"
resolv-conf = "0.7.0"
# This actually relies on many other features in Tokio, so this will probably
# fail to build outside the workspace. <https://github.com/firezone/firezone/pull/4328#discussion_r1540342142>
tokio = { version = "1.36.0", features = ["signal"] }
tracing = { workspace = true }
url = { version = "2.3.1", default-features = false }

[dev-dependencies]
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"

[target.'cfg(target_os = "linux")'.dependencies]
connlib-client-shared = { workspace = true }
connlib-shared = { workspace = true }
resolv-conf = "0.7.0"
tracing = { workspace = true }
secrecy = { workspace = true }
firezone-cli-utils = { workspace = true }

[target.'cfg(target_os = "linux")'.dev-dependencies]
dirs = "5.0.1"
nix = { version = "0.28.0", features = ["user"] }
Expand Down
1 change: 0 additions & 1 deletion rust/connlib/clients/android/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ mock = ["connlib-client-shared/mock"]

[dependencies]
secrecy = { workspace = true }
tracing-android = "0.2"
tracing = { workspace = true, features = ["std", "attributes"] }
tracing-subscriber = { workspace = true }
tracing-appender = "0.2"
Expand Down
2 changes: 0 additions & 2 deletions rust/connlib/clients/apple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ edition = "2021"
mock = ["connlib-client-shared/mock"]

[build-dependencies]
anyhow = "1.0.81"
swift-bridge-build = "0.1.52"
walkdir = "2.5.0"

[dependencies]
secrecy = { workspace = true }
Expand Down
3 changes: 0 additions & 3 deletions rust/connlib/clients/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ mock = ["connlib-shared/mock"]
[dependencies]
anyhow = "1.0.81"
tokio = { version = "1.36", default-features = false, features = ["sync", "rt"] }
tokio-util = "0.7.10"
secrecy = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
Expand All @@ -23,9 +22,7 @@ serde = { version = "1.0", default-features = false, features = ["std", "derive"
backoff = { workspace = true }
url = { version = "2.4.1", features = ["serde"] }
time = { version = "0.3.34", features = ["formatting"] }
reqwest = { version = "0.12.1", default-features = false, features = ["stream", "rustls-tls"] }
tokio-tungstenite = { version = "0.21", default-features = false, features = ["connect", "handshake", "rustls-tls-webpki-roots"] }
async-compression = { version = "0.4.6", features = ["tokio", "gzip"] }
parking_lot = "0.12"
bimap = "0.6"
ip_network = { version = "0.4", default-features = false }
Expand Down
10 changes: 3 additions & 7 deletions rust/connlib/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ chrono = { workspace = true }
futures = { version = "0.3", default-features = false, features = ["std", "async-await", "executor"] }
futures-util = { version = "0.3", default-features = false, features = ["std", "async-await", "async-await-macro"] }
ip_network = { version = "0.4", default-features = false, features = ["serde"] }
# Needed to mark functions as exempt from `cargo-mutants` testing
mutants = "0.0.3"
os_info = { version = "3", default-features = false }
parking_lot = "0.12"
rand = { version = "0.8", default-features = false, features = ["std"] }
Expand All @@ -27,19 +25,15 @@ resolv-conf = "0.7.0"
serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
thiserror = { version = "1.0", default-features = false }
tokio = { version = "1.36", default-features = false, features = ["rt", "rt-multi-thread"]}
tokio = { version = "1.36", default-features = false, features = ["rt", "rt-multi-thread", "fs"]}
tokio-stream = { version = "0.1", features = ["time"] }
tokio-tungstenite = { version = "0.21", default-features = false, features = ["connect", "handshake", "rustls-tls-webpki-roots"] }
tracing = { workspace = true }
tracing-appender = "0.2"
url = { version = "2.4.1", default-features = false }
uuid = { version = "1.7", default-features = false, features = ["std", "v4", "serde"] }
ring = "0.17"
hickory-resolver = { workspace = true }
domain = { workspace = true }
libc = "0.2"
dns-lookup = { workspace = true }
known-folders = "1.1.0"
snownet = { workspace = true }
phoenix-channel = { workspace = true }

Expand All @@ -50,6 +44,7 @@ log = "0.4"
anyhow = "1.0"
itertools = "0.12"
tempfile = "3.10.1"
mutants = "0.0.3" # Needed to mark functions as exempt from `cargo-mutants` testing

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
swift-bridge = { workspace = true }
Expand All @@ -67,6 +62,7 @@ rtnetlink = { workspace = true }
# Windows tunnel dependencies
[target.'cfg(target_os = "windows")'.dependencies]
wintun = "0.4.0"
known-folders = "1.1.0"

# Windows Win32 API
[target.'cfg(windows)'.dependencies.windows]
Expand Down
6 changes: 3 additions & 3 deletions rust/connlib/snownet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ version = "1.0.0"
edition = "2021"

[dependencies]
anyhow = "1"
boringtun = { workspace = true }
firezone-relay = { workspace = true }
pnet_packet = { version = "0.34" }
rand = "0.8"
secrecy = { workspace = true }
Expand All @@ -20,7 +18,9 @@ bytes = "1.4.0"
once_cell = "1.17.1"
backoff = "0.4.0"
hex = "0.4.0"
tracing-subscriber = { workspace = true }

[dev-dependencies]
tracing-subscriber = "0.3"

[lints]
workspace = true
1 change: 0 additions & 1 deletion rust/connlib/snownet/src/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ mod tests {
use stun_codec::{
rfc5389::errors::{BadRequest, ServerError},
rfc5766::errors::AllocationMismatch,
Message,
};

const PEER1: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 10000);
Expand Down
11 changes: 2 additions & 9 deletions rust/connlib/snownet/src/stun_binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,8 @@ enum State {
#[cfg(test)]
mod tests {
use super::*;
use bytecodec::DecodeExt;
use std::{
net::{Ipv4Addr, SocketAddrV4},
time::Duration,
};
use stun_codec::{
rfc5389::{attributes::XorMappedAddress, methods::BINDING},
Message,
};
use std::net::{Ipv4Addr, SocketAddrV4};
use stun_codec::rfc5389::methods::BINDING;

const SERVER1: SocketAddr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, 3478));
const SERVER2: SocketAddr =
Expand Down
1 change: 0 additions & 1 deletion rust/firezone-cli-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ip_network = "0.4"
url = { version = "2.3.1", default-features = false }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tracing = { workspace = true }
Expand Down

0 comments on commit 97e6a92

Please sign in to comment.