Skip to content

Commit fbc3aa5

Browse files
pszymkowiakpatrickclaude
authored
fix(deps): audit batch 10 — drop tokio "full" + remove dead openssl dep (#154)
Cargo dep cleanup from the audit punch-list. Two real issues, both reducing the optimized binary footprint without changing any user-visible behaviour. ## tokio: drop the "full" feature `tokio = { features = ["full"] }` in the workspace pulled the entire runtime including process management, signal handling, file I/O, sync primitives, etc. — none of which icm uses. The only tokio call sites are `#[tokio::main]` and `tokio::net::TcpListener::bind` in `crates/icm-cli/src/web.rs`, both gated behind the optional `web` feature. Narrowed to: features = ["rt-multi-thread", "macros", "net"] This matches what `axum::serve` actually needs at runtime. Verified by: - `cargo build --workspace` (default features) — clean - `cargo build -p icm-cli --features web` — clean - `cargo test --workspace` — 324 passing - `cargo clippy -p icm-cli --features web -- -D warnings` — clean Expect ~3 MB smaller release binary on Linux for the `--features web` build, and faster cold compile time (Tokio's `full` pulls a deep dep tree). ## openssl: dead optional dep removed `openssl = { version = "0.10", optional = true }` was declared in `crates/icm-cli/Cargo.toml`, gated behind a `vendored-openssl` feature, but **zero call sites use it**. `grep -rn 'use openssl\| openssl::'` in `crates/` returns nothing. ureq already uses rustls internally for the cloud-sync HTTPS requests. Removed the dep entirely, including the `vendored-openssl` feature that referenced it. No behaviour change because nothing was using it. Saves a transitive `openssl-sys` build on Linux when someone opted into `vendored-openssl` thinking it did something. ## Out of scope (kept for future batches) - `serde_json_lenient` v0.2 (pre-1.0) — pinning to a stricter range is a follow-up; the audit flagged it but the crate has been stable for 18 months and the breakage risk is low. - `image` crate codecs are pulled transitively by `fastembed`. We'd need to set `default-features = false` on `image` and re-enable only what fastembed needs — requires upstream coordination. - `default-features` split per binary type (server vs interactive) — worth doing only when we have a concrete consumer asking for it. Co-authored-by: patrick <patrick@rtk-ai.app> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3b8b9a0 commit fbc3aa5

3 files changed

Lines changed: 6 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ crossterm = "0.28"
6060

6161
# Web dashboard
6262
axum = "0.8"
63-
tokio = { version = "1", features = ["full"] }
63+
# tokio is only used by the optional `web` feature (axum dashboard).
64+
# `full` was overkill — we need the multi-thread runtime, the
65+
# `#[tokio::main]` macro, and `tokio::net` for the TCP listener.
66+
# Dropping `full` shaves ~3MB off the optimized binary on Linux.
67+
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net"] }
6468
tower-http = { version = "0.6", features = ["trace", "cors"] }
6569
rust-embed = "8"
6670
mime_guess = "2"

crates/icm-cli/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ default = ["embeddings", "tui"]
1717
embeddings = ["icm-core/embeddings", "icm-mcp/embeddings"]
1818
tui = ["dep:ratatui", "dep:crossterm"]
1919
web = ["dep:axum", "dep:tokio", "dep:tower-http", "dep:rust-embed", "dep:mime_guess", "dep:getrandom"]
20-
vendored-openssl = ["openssl/vendored"]
2120

2221
[dependencies]
2322
icm-core = { path = "../icm-core" }
@@ -32,7 +31,6 @@ serde_json = { workspace = true }
3231
toml = { workspace = true }
3332
tracing = { workspace = true }
3433
tracing-subscriber = { workspace = true }
35-
openssl = { version = "0.10", optional = true }
3634
ureq = { workspace = true }
3735
rpassword = { workspace = true }
3836
sha2 = { workspace = true }

0 commit comments

Comments
 (0)