Skip to content

build(deps): drop three dependency features nothing activates - #1201

Merged
jlucaso1 merged 1 commit into
mainfrom
claude/audit-optimize-dependencies-uk195m
Jul 30, 2026
Merged

build(deps): drop three dependency features nothing activates#1201
jlucaso1 merged 1 commit into
mainfrom
claude/audit-optimize-dependencies-uk195m

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Second sweep over the dependency surface after #1200. The headline is that there is not much left: no crate leaves the graph, Cargo.lock is unchanged, and the three changes here are features being compiled with no caller. The audit trail below is the more useful half of this PR — it records what was checked and found load-bearing, so the same ground does not get re-covered.

Changes

  • futures' thread-pool, wacore dev-dependencies. ThreadPool appears nowhere in the crate's tests, benches or examples. Costs no package (futures 0.3.33 replaced num_cpus with available_parallelism), only the module's compile time.
  • syn's parsing, root dev-dependencies. Already in syn 3.0's default set, and default-features was never disabled, so the entry restated what was on. full is not default and stays.
  • wacore-binary's serde, in wacore-appstate. appstate builds and tests clean without it. wacore does need it and still declares it, so a workspace build resolves the same feature set either way; the difference is for anyone depending on wacore-appstate alone, who no longer pulls serde derives for every node type plus smallvec/serde.

Method

Each candidate was removed and rebuilt, not just read. That order matters more than it sounds: feature unification makes a single-crate cargo check lie. Dropping wacore-binary/serde from wacore appeared to work — cargo check -p wacore --lib passed clean — and only failed once appstate's copy came out too, because appstate had been enabling the feature on wacore's behalf the whole time. The conclusion flipped from "wacore doesn't need serde" to "appstate doesn't need serde" on that second build.

Audit trail: checked, found load-bearing

Recording these so the next pass can skip them.

No unused dependencies remain. A cross-check of every [dependencies], [dev-dependencies] and [build-dependencies] entry in all 14 manifests against actual source references found zero orphans. Four flagged by the naive scan are legitimate: dhat and getrandom in wacore are feature-only (dhat-heap, js), serde_repr in waproto is referenced from generated code via cfg_attr in build.rs, and libsqlite3-sys is an optional pin.

Features that looked droppable but are not:

Candidate Why it stays
curve25519-dalek / x25519-dalek precomputed-tables ED25519_BASEPOINT_TABLE is used directly in core/curve/curve25519.rs for XEdDSA signing. The constant only exists with the feature.
cbc's block-padding (via defaults) Pkcs7 is used in production crypto in crypto/provider.rs.
tracing's attributes tracing::instrument is used across usync.rs, download.rs and others.
yoke's derive Not in yoke 0.8's default set, and derive(Yokeable) is used in node.rs and jid.rs.
zerocopy's derive FromBytes/KnownLayout/Immutable/Unaligned derives in voip/rtp.rs and voip/stun.rs.
chrono's serde in wacore chrono::serde::ts_seconds on event and message timestamps.
rand's std_rng / thread_rng StdRng and rand::rng() are both used, including outside tests.
smallvec's serde Enabled by wacore-binary's own serde feature for node attrs, not by accident.
futures facade → futures-util The facade is used across nearly all its sub-crates: channel::oneshot, executor::block_on, task::ArcWake, the select!/join! macros, and stream. Narrowing would mean four separate deps, not one.
async-trait 99 #[async_trait] sites against 551 dyn uses. Native async-in-trait is not dyn-safe, so this is structural, not vestigial.
all five webrtc-* crates Each is referenced from voip/transport.rs, including the deliberate dual webrtc-util majors already documented in deny.toml.

Duplicate versions are not actionable from here. The 42 duplicated packages are almost entirely the webrtc tree lagging a RustCrypto generation behind (optional, off by default) and are already enumerated with rationale in deny.toml. The two that show up in a default build were traced to their parents: getrandom 0.2.17 comes from ring, hashbrown 0.15.5 from buffa — both upstream pins with no manifest-side lever.

No functional overlap to collapse. The default build carries three UTF-8 crates (simdutf8, utf8-zero, smoothutf8); they arrive from tokio-websockets, ureq, and our own wacore respectively, so no one of them can substitute for another.

Cost

Cargo.lock unchanged, 462 packages before and after, and the size job confirms zero codegen change: llvm-lines are flat to the line in all four metrics (wacore 511,608 both sides; root lib 727,450 both sides; both copy counts unchanged).

The reported binary numbers move by +832 B stripped (+0.01%). That is link-layout noise, not this diff: nothing here changes what is compiled into a build that includes wacore, two of the three trims are dev-only, and flat llvm-lines mean no instruction was added or removed. For calibration, #1200's size delta swung from +192 B to −1.56 KiB across two commits whose codegen barely differed, so ±1 KiB on this gate is below its own resolution.

The real gain is compile time and a smaller standalone footprint for wacore-appstate.

Validation

cargo check --workspace --all-targets --exclude whatsapp-rust-voip-cli
cargo test --workspace --exclude whatsapp-rust-voip-cli --exclude e2e-tests --exclude bench-integration

All green, 1900+ tests. whatsapp-rust-voip-cli is excluded because its cpal to alsa-sys chain needs ALSA headers this environment lacks; it was not touched.

Semver Checks (informational) is red and is not this PR's: the same 63 findings appear on main, all waproto::whatsapp::* generated protobuf types drifting from the published 0.6.0 baseline, none naming wacore or wacore-binary. See the comment thread for the base-branch evidence.

A second sweep over the manifests after the round-1 cuts. No crate leaves
the graph this time; these are features being compiled for no caller:

- futures' `thread-pool` in wacore's dev-dependencies. `ThreadPool` appears
  nowhere in the crate's tests, benches or examples. Costs no package
  (futures 0.3.33 dropped num_cpus for available_parallelism), only the
  module's compile time.
- syn's `parsing` in the root dev-dependencies. It is already in syn 3.0's
  default set and default-features was never disabled, so the entry only
  restated what was on. `full` is not default and stays.
- wacore-binary's `serde` in wacore-appstate. appstate builds and tests
  clean without it; wacore needs it and still declares it, so a workspace
  build resolves the same feature set either way. The difference is for
  anyone depending on wacore-appstate alone, who no longer pulls serde
  derives for every node type plus smallvec/serde.

Verified by removal rather than by reading: each was taken out and the
workspace rebuilt. That order matters here, because feature unification
makes a single-crate `cargo check` lie. Dropping `wacore-binary/serde`
from wacore first appeared to work, and only failed once appstate's copy
came out too, since appstate had been enabling it for wacore all along.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jlucaso1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6166327e-d82f-4084-9cf5-e85b7b84e67a

📥 Commits

Reviewing files that changed from the base of the PR and between 4c24b01 and e433a24.

📒 Files selected for processing (3)
  • Cargo.toml
  • wacore/Cargo.toml
  • wacore/appstate/Cargo.toml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📦 Binary size report

Metric main PR Δ
bin size (stripped) 9.95 MiB 9.95 MiB +832 B (+0.01%) 🔺
bin .text 7.97 MiB 7.97 MiB +768 B (+0.01%) 🔺
bin allocated (text+data+bss) 9.95 MiB 9.95 MiB +3.98 KiB (+0.04%) 🔺
llvm-lines wacore 511,608 511,608 0
llvm-lines wacore copies 16,704 16,704 0
llvm-lines whatsapp-rust lib 727,450 727,450 0
llvm-lines whatsapp-rust lib copies 22,955 22,955 0
deps crates (Cargo.lock) 462 462 0
.text per crate
Crate main PR Δ
.text whatsapp_rust 1.80 MiB 1.80 MiB -401 B (-0.02%) 🔽
.text wacore 687.33 KiB 687.43 KiB +99 B (+0.01%) 🔺
.text wacore_binary 91.42 KiB 91.42 KiB 0
.text wacore_libsignal 170.74 KiB 170.64 KiB -99 B (-0.06%) 🔽
.text wacore_appstate 22.35 KiB 22.35 KiB 0
.text wacore_noise 21.79 KiB 21.79 KiB 0
.text waproto 1.74 MiB 1.74 MiB 0
.text whatsapp_rust_sqlite_storage 515.96 KiB 515.70 KiB -266 B (-0.05%) 🔽
.text whatsapp_rust_tokio_transport 40.49 KiB 40.49 KiB 0
.text whatsapp_rust_ureq_http_client 11.83 KiB 11.83 KiB 0
.text std 984.91 KiB 984.91 KiB 0
.text other deps 1.90 MiB 1.90 MiB +1.41 KiB (+0.07%) 🔺

Baseline: 4c24b01ab (latest main run) · Head: 125b7d46b · Graphs

@jlucaso1
jlucaso1 merged commit 9c3e96f into main Jul 30, 2026
22 of 23 checks passed
@jlucaso1
jlucaso1 deleted the claude/audit-optimize-dependencies-uk195m branch July 30, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants