Skip to content

refactor: consolidate core dependencies at workspace level (phase 1)#2253

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
yannham/workspace-level-deps1
Jul 23, 2026
Merged

refactor: consolidate core dependencies at workspace level (phase 1)#2253
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
yannham/workspace-level-deps1

Conversation

@yannham

@yannham yannham commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR implements Phase 1 of the workspace dependencies migration plan, consolidating the following core dependencies at the workspace level:

  • serde (1.0): 21 crates
  • anyhow (1.0): 28 crates
  • tokio (1.36): 15 crates
  • tracing (0.1): 13 crates

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 = true instead of specifying versions individually:

  • Preserves feature flags and optional flags
  • Single source of truth for version specifications

Validation

cargo check --workspace
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features
cargo test --doc

Note: 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:

  • Phase 2: Build system (build_common, prost-build, etc.)
  • Phase 3: Async/utilities (futures, io-lifetimes, hyper, etc.)
  • Phase 4: Dev/testing (tempfile, criterion, bolero, etc.)
  • Phase 5: Internal workspace crates (libdd-, datadog-)

See workspace-deps-migration.md for the full migration plan.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 20, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 74.64% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5878203 | Docs | Datadog PR Page | Give us feedback!

@bwoebi

bwoebi commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Before doing Phase 5, please check whether this works properly with dd-trace-php.

@dd-octo-sts

dd-octo-sts Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.13 MB 8.13 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 88.33 MB 88.33 MB +0% (+480 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 99.62 MB 99.62 MB +0% (+2.32 KB) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.94 MB 10.94 MB +0% (+8 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.65 MB 26.65 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 89.18 KB 89.18 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 191.78 MB 191.80 MB +.01% (+24.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 1.04 GB 1.04 GB +0% (+586 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.68 MB 8.68 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 89.18 KB 89.18 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.40 MB 25.40 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 50.65 MB 50.65 MB +0% (+184 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.21 MB 23.21 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 90.58 KB 90.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 196.54 MB 196.51 MB --.01% (-24.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 1.03 GB 1.03 GB +0% (+2.51 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.70 MB 6.70 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 90.58 KB 90.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.31 MB 27.32 MB +.02% (+8.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.22 MB 48.23 MB +.01% (+5.10 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 78.78 MB 78.78 MB +0% (+488 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.07 MB 9.07 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.28 MB 94.28 MB +0% (+1.24 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.04 MB 11.04 MB 0% (0 B) 👌

@yannham
yannham force-pushed the yannham/workspace-level-deps1 branch 2 times, most recently from c30da83 to 096d8fc Compare July 20, 2026 13:16
@pr-commenter

pr-commenter Bot commented Jul 20, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-07-23 15:45:21

Comparing candidate commit 5878203 in PR branch yannham/workspace-level-deps1 with baseline commit 919c275 in branch main.

Found 4 performance improvements and 2 performance regressions! Performance is the same for 171 metrics, 10 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:alloc_free/sampled_system_fast_path/4096

  • 🟥 execution_time [+10.761ns; +10.909ns] or [+11.591%; +11.751%]

scenario:alloc_free/sampled_system_slow_path/4096

  • 🟩 execution_time [-7.699ns; -7.592ns] or [-4.916%; -4.848%]

scenario:glob_matcher/ascii_pattern_unicode_subject/wall_time

  • 🟥 execution_time [+8.242ns; +8.316ns] or [+6.002%; +6.056%]

scenario:glob_matcher/ascii_wildcard_star_match/wall_time

  • 🟩 execution_time [-4.301ns; -4.282ns] or [-10.444%; -10.399%]

scenario:trace_buffer/4_senders/no_delay

  • 🟩 execution_time [-164.341µs; -137.102µs] or [-6.639%; -5.539%]
  • 🟩 throughput [+86753.942op/s; +104433.659op/s] or [+5.962%; +7.178%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@yannham yannham changed the title Phase 1: Consolidate core dependencies at workspace level refactor: consolidate core dependencies at workspace level (phase 1) Jul 20, 2026
@yannham
yannham marked this pull request as ready for review July 20, 2026 14:54
@yannham
yannham requested review from a team as code owners July 20, 2026 14:54
@yannham
yannham requested review from leoromanovsky, mabdinur and sameerank and removed request for a team July 20, 2026 14:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Cargo.toml
Comment on lines +91 to +94
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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's on purpose. Leaf crates should use the minimal set of features they actually need.

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

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.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit b68e14f · What is Autotest? · Any feedback? Reach out in #autotest

@yannham
yannham force-pushed the yannham/workspace-level-deps1 branch from b68e14f to d288a46 Compare July 20, 2026 15:51

@leoromanovsky leoromanovsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffe lgtm

@yannham
yannham force-pushed the yannham/workspace-level-deps1 branch 2 times, most recently from 7e34259 to 51c0364 Compare July 22, 2026 13:58
yannham added 2 commits July 23, 2026 16:57
- 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.
@yannham
yannham force-pushed the yannham/workspace-level-deps1 branch from 51c0364 to 5878203 Compare July 23, 2026 14:57
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 15899df into main Jul 23, 2026
93 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the yannham/workspace-level-deps1 branch July 23, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants