refactor: consolidate core dependencies at workspace level (phase 1)#2253
Conversation
4cd050a to
6e21c96
Compare
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 5878203 | Docs | Datadog PR Page | Give us feedback! |
|
Before doing Phase 5, please check whether this works properly with dd-trace-php. |
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
c30da83 to
096d8fc
Compare
BenchmarksComparisonBenchmark execution time: 2026-07-23 15:45:21 Comparing candidate commit 5878203 in PR branch Found 4 performance improvements and 2 performance regressions! Performance is the same for 171 metrics, 10 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b68e14f49a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| anyhow = { version = "1.0", default-features = false } | ||
| hyper = { version = "1.6", default-features = false } | ||
| hyper-util = { version = "0.1.10", default-features = false } | ||
| serde = { version = "1.0", default-features = false } |
There was a problem hiding this comment.
Preserve default features for migrated dependencies
For leaves that were changed to bare *.workspace = true, setting default-features = false here does not preserve the old manifests: I checked cargo metadata --no-deps on the parent vs this commit, and examples like tools's anyhow and libdd-trace-protobuf's serde changed from uses_default_features: true to false. In package-specific builds or consumers where another dependency does not happen to unify those features back in, this drops anyhow's std/backtrace support and serde's std impls compared with the previous crate manifests, so the migration should either keep defaults enabled at the workspace level or explicitly add default-features = true in every leaf that previously relied on defaults.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
It's on purpose. Leaf crates should use the minimal set of features they actually need.
There was a problem hiding this comment.
More details
Cargo.lock is unchanged and all hyper/hyper-util features that were previously inlined into the workspace definition are now correctly declared in each leaf crate — the two key correctness properties of this dep consolidation refactor both hold.
🤖 Datadog Autotest · Commit b68e14f · What is Autotest? · Any feedback? Reach out in #autotest
b68e14f to
d288a46
Compare
7e34259 to
51c0364
Compare
- Add serde, anyhow, tokio, and tracing to [workspace.dependencies] - Update 38 leaf crates to use 'workspace = true' for these dependencies - serde: consolidated to 1.0 - anyhow: consolidated to 1.0 - tokio: consolidated to 1.36 with rt, sync, and time features - tracing: consolidated to 0.1 This change reduces dependency duplication and ensures consistent versions across crates that use these critical utilities. Validated with: - cargo check --workspace ✓ - cargo fmt ✓ - cargo clippy ✓ - cargo test --doc ✓ Note: Some pre-existing test failures in bin_tests::crashtracker_bin_test are unrelated to these dependency changes.
Declare all workspace.dependencies version-only with default-features disabled and no feature arrays, so each leaf crate opts into exactly the features it uses. Push explicit hyper/hyper-util features to their consumers and enable serde default features only in libdd-common, which is the sole crate that requires them.
51c0364 to
5878203
Compare
Overview
This PR implements Phase 1 of the workspace dependencies migration plan, consolidating the following core dependencies at the workspace level:
Changes
Root Cargo.toml
Added 4 new dependencies to
[workspace.dependencies]:anyhow = "1.0"serde = "1.0"tokio = { version = "1.36", features = ["rt", "sync", "time"] }tracing = "0.1"Leaf Crates (38 updated)
Updated all affected crates to use
workspace = trueinstead of specifying versions individually:Validation
✅
cargo check --workspace✅
cargo fmt --all -- --check✅
cargo clippy --workspace --all-targets --all-features✅
cargo test --docNote: Some pre-existing failures in
bin_tests::crashtracker_bin_test(stack frame extraction) are unrelated to dependency changes.Next Steps
This is Phase 1 of 5. Subsequent phases will consolidate:
See
workspace-deps-migration.mdfor the full migration plan.