Skip to content

chore: moving to workspace-level dependencies, phase 2 - #2270

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
yannham/workspace-deps-phase-2
Jul 27, 2026
Merged

chore: moving to workspace-level dependencies, phase 2#2270
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
yannham/workspace-deps-phase-2

Conversation

@yannham

@yannham yannham commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of the workspace dependencies migration, following phase 1 (#2253).

Adds four dependencies to [workspace.dependencies] and migrates all leaf crates to use workspace = true.

Dependencies migrated

Dependency Version Crates migrated
build_common path = "build-common" 15 (all -ffi crates + builder)
prost-build 0.14.1 2 (libdd-ddsketch, libdd-trace-protobuf)
protoc-bin-vendored 3.0.0 2 (libdd-ddsketch, libdd-trace-protobuf)
serde_json 1.0 22 (workspace-wide; unifies pinned variants 1.0.117/1.0.127/1.0.132)

Feature auditing (serde_json)

Each of the 22 leaf crates that previously used serde_json = "1.0" (default features = std) was compiled individually with cargo check -p <crate> --all-targets with no features first:

  • 18 crates: compile cleanly with no features — serde_json.workspace = true
  • 4 crates (libdd-profiling-ffi, libdd-telemetry-ffi, libdd-tinybytes, libdd-trace-protobuf): use Value and from_str which need at least the alloc feature → features = ["alloc"]. Full std is not required.

Validation

  • cargo check --workspace --exclude builder
  • cargo +nightly-2026-02-08 fmt --all -- --check

@datadog-official

datadog-official Bot commented Jul 24, 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.67% (+0.04%)

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

@pr-commenter

pr-commenter Bot commented Jul 24, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-07-27 15:43:19

Comparing candidate commit fbb2632 in PR branch yannham/workspace-deps-phase-2 with baseline commit be0b543 in branch main.

Found 5 performance improvements and 22 performance regressions! Performance is the same for 150 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 [+9.387ns; +9.530ns] or [+9.857%; +10.006%]

scenario:alloc_free/sampled_system_slow_path/4096

  • 🟥 execution_time [+10.480ns; +10.597ns] or [+7.101%; +7.180%]

scenario:alloc_free/system/16

  • 🟩 execution_time [-1.169ns; -1.119ns] or [-7.562%; -7.243%]

scenario:alloc_free/system/256

  • 🟩 execution_time [-1.173ns; -1.105ns] or [-7.581%; -7.142%]

scenario:alloc_free/system/64

  • 🟩 execution_time [-1.201ns; -1.157ns] or [-7.755%; -7.475%]

scenario:credit_card/is_card_number/ 3782-8224-6310-005

  • 🟥 execution_time [+4.183µs; +4.581µs] or [+5.457%; +5.976%]
  • 🟥 throughput [-743219.677op/s; -676289.729op/s] or [-5.695%; -5.182%]

scenario:credit_card/is_card_number/ 378282246310005

  • 🟥 execution_time [+5.370µs; +5.473µs] or [+7.859%; +8.010%]
  • 🟥 throughput [-1085104.887op/s; -1066020.647op/s] or [-7.414%; -7.284%]

scenario:credit_card/is_card_number/378282246310005

  • 🟥 execution_time [+5.683µs; +5.798µs] or [+8.721%; +8.898%]
  • 🟥 throughput [-1253344.244op/s; -1230478.326op/s] or [-8.168%; -8.019%]

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟥 execution_time [+7.302µs; +7.357µs] or [+15.947%; +16.067%]
  • 🟥 throughput [-3025642.566op/s; -3001854.737op/s] or [-13.853%; -13.744%]

scenario:credit_card/is_card_number_no_luhn/ 378282246310005

  • 🟥 execution_time [+4.902µs; +4.940µs] or [+9.161%; +9.232%]
  • 🟥 throughput [-1579435.280op/s; -1568117.110op/s] or [-8.452%; -8.391%]

scenario:credit_card/is_card_number_no_luhn/378282246310005

  • 🟥 execution_time [+5.165µs; +5.214µs] or [+10.271%; +10.368%]
  • 🟥 throughput [-1868087.357op/s; -1852084.627op/s] or [-9.394%; -9.313%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟥 execution_time [+7.361µs; +7.411µs] or [+16.070%; +16.179%]
  • 🟥 throughput [-3043208.360op/s; -3020232.507op/s] or [-13.939%; -13.834%]

scenario:ddsketch_encode/encode_to_vec/clustered_near_zero

  • 🟥 execution_time [+48.745ns; +53.894ns] or [+6.993%; +7.732%]

scenario:ddsketch_encode/encode_to_vec/large_values

  • 🟥 execution_time [+66.159ns; +69.904ns] or [+7.903%; +8.350%]

scenario:ddsketch_encode/encode_to_vec/mixed

  • 🟥 execution_time [+83.060ns; +87.759ns] or [+6.785%; +7.169%]

scenario:glob_matcher/ascii_case_insensitive_match/wall_time

  • 🟥 execution_time [+2.588ns; +2.623ns] or [+9.690%; +9.820%]

scenario:glob_matcher/ascii_exact_match/wall_time

  • 🟥 execution_time [+2.645ns; +2.672ns] or [+9.916%; +10.015%]

scenario:glob_matcher/ascii_exact_miss/wall_time

  • 🟥 execution_time [+2.390ns; +2.444ns] or [+20.625%; +21.090%]

scenario:trace_buffer/4_senders/no_delay

  • 🟩 execution_time [-238.408µs; -210.574µs] or [-9.565%; -8.448%]
  • 🟩 throughput [+135680.282op/s; +154784.257op/s] or [+9.391%; +10.714%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch from 2ba3535 to 01f0e3a Compare July 24, 2026 12:12
@yannham yannham changed the title refactor: consolidate build system & protobuf deps at workspace level (phase 2) chore: moving to workspace-level dependencies, phase 2 Jul 24, 2026
@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch 2 times, most recently from 08e7e23 to d13ce49 Compare July 24, 2026 12:17
@yannham
yannham marked this pull request as ready for review July 24, 2026 12:19
@yannham
yannham requested review from a team as code owners July 24, 2026 12:19
@yannham
yannham requested review from dd-oleksii, leoromanovsky and vpellan and removed request for a team July 24, 2026 12:19

@datadog-official datadog-official 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: FAIL

The workspace-level serde_json declaration disables default features, but 15 migrated leaf dependencies inherit no replacement feature; production crates such as libdd-agent-client, libdd-telemetry, and libdd-sampling use allocation-gated JSON APIs. Their standalone builds therefore fail instead of producing the libraries consumed by downstream SDKs. No additional tests recommended: this is a manifest feature-resolution failure, not a runtime input class.

📊 Validated against 1 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit d13ce49 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread Cargo.toml Outdated
@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch from d13ce49 to 0db03dd Compare July 24, 2026 12:21
@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch from 0db03dd to 0bf433a Compare July 24, 2026 12:25

@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: d13ce491c5

ℹ️ 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 Outdated
@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch from 0bf433a to 525ea94 Compare July 24, 2026 12:45
@dd-octo-sts

dd-octo-sts Bot commented Jul 24, 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.a 87.13 MB 87.13 MB +0% (+4.51 KB) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.01 MB 8.01 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.77 MB 10.77 MB +0% (+504 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 98.38 MB 98.41 MB +.02% (+27.46 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.00 MB 26.00 MB +.01% (+3.50 KB) 🔍
/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 187.92 MB 187.94 MB +0% (+16.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 978.93 MB 979.40 MB +.04% (+478.10 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.47 MB 8.47 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.05 MB 25.05 MB --.03% (-8.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 49.84 MB 49.84 MB -0% (-1.29 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.61 MB 22.64 MB +.12% (+29.50 KB) 🔍
/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 192.51 MB 192.62 MB +.05% (+112.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 968.14 MB 968.47 MB +.03% (+344.30 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.54 MB 6.54 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 26.91 MB 26.91 MB +.02% (+8.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 47.43 MB 47.43 MB +0% (+1.94 KB) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 77.74 MB 77.73 MB -0% (-3.89 KB) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.91 MB 8.91 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 93.20 MB 93.23 MB +.03% (+29.83 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.84 MB 10.85 MB +.04% (+4.60 KB) 🔍

@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch 2 times, most recently from e73b806 to 04c4c8a Compare July 24, 2026 13:46
Comment thread Cargo.toml
@yannham
yannham requested a review from hoolioh July 24, 2026 13:55
@yannham

yannham commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 67f7856269

ℹ️ 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 libdd-trace-utils/Cargo.toml Outdated
yannham and others added 3 commits July 27, 2026 11:21
… (phase 2)

Add build_common, prost-build, protoc-bin-vendored, and serde_json to
[workspace.dependencies] and migrate all leaf crates to workspace = true.

- build_common: 15 FFI/build crates (all -ffi crates + builder)
- prost-build, protoc-bin-vendored: libdd-ddsketch, libdd-trace-protobuf
- serde_json: 22 crates (unifies pinned versions 1.0.117/1.0.127/1.0.132)

All workspace deps declare default-features = false per the new policy.
Each leaf crate that previously relied on implicit defaults now explicitly
opts into the minimum required feature set:
- 14 crates work with no features at all (serde_json not in their direct
  compile path or uses only alloc-compatible APIs transitively)
- 4 crates (libdd-profiling-ffi, libdd-telemetry-ffi, libdd-tinybytes,
  libdd-trace-protobuf) need serde_json Value/from_str: features=["alloc"]
  is sufficient; full std is not required

Also documents the default-features = false policy in
workspace-deps-migration.md so future phases follow the same discipline.
@yannham
yannham force-pushed the yannham/workspace-deps-phase-2 branch from c550154 to d729024 Compare July 27, 2026 09:21
Migrating build_common to a workspace dependency touches how downstream
users of libdatadog integrate this internal build-tooling crate. Delay
consolidating internal crates and keep this phase scoped to external
dependencies (prost-build, protoc-bin-vendored, serde_json).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the common label Jul 27, 2026
@yannham

yannham commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

FYI: as requested by the PHP team, I reverted the build_common migration, keeping all internal dependencies for the last PR, as this might need some adaptation on their side.

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.

2 participants