Skip to content

fix(protos): honor PROTOC for protobuf codegen - #2370

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
ilya/honor-protoc-env
Aug 19, 2026
Merged

fix(protos): honor PROTOC for protobuf codegen#2370
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
ilya/honor-protoc-env

Conversation

@embeaken

@embeaken embeaken commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the conventional PROTOC environment variable for the protobuf-codegen invocations in datadog-protos when it is set. Continue searching PATH when it is unset so existing Cargo builds keep working.

Also declare PROTOC as a build-script input so Cargo reruns code generation when it changes.

This allows hermetic build systems such as Bazel to provide an explicitly declared compiler instead of requiring protoc on the host PATH.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

Ran the datadog-protos check both with an explicit compiler and with the existing PATH fallback:

PROTOC=/opt/homebrew/bin/protoc cargo check -p datadog-protos
env -u PROTOC cargo check -p datadog-protos

@dd-octo-sts dd-octo-sts Bot added the area/io General I/O and networking. label Aug 19, 2026
@embeaken
embeaken marked this pull request as ready for review August 19, 2026 21:02
@embeaken
embeaken requested a review from a team as a code owner August 19, 2026 21:02

@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: 79e62c3100

ℹ️ 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 lib/protos/datadog/build.rs Outdated
@pr-commenter

pr-commenter Bot commented Aug 19, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: bfbd168 · Comparison: b1bc60b · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.55 MiB (baseline) vs 41.55 MiB (comparison)
Size Change: -264 B (-0.00%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.9b66f8c6094f89350371ac7937de7c72.830.llvm.14734938299648409202 -17.00 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.830.llvm.7519367550485861600 +17.00 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.200.llvm.7519367550485861600 +10.18 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.200.llvm.14734938299648409202 -10.18 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.816.llvm.7519367550485861600 +9.61 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.816.llvm.14734938299648409202 -9.61 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.811.llvm.14734938299648409202 -4.58 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.811.llvm.7519367550485861600 +4.57 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.28.llvm.14734938299648409202 -3.65 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.28.llvm.7519367550485861600 +3.65 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.637.llvm.7519367550485861600 +3.28 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.637.llvm.14734938299648409202 -3.28 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.826.llvm.7519367550485861600 +2.83 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.826.llvm.14734938299648409202 -2.83 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.1055.llvm.14734938299648409202 -2.60 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.1055.llvm.7519367550485861600 +2.59 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.828.llvm.14734938299648409202 -2.47 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.828.llvm.7519367550485861600 +2.47 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.185.llvm.14734938299648409202 -1.77 KiB 1
anon.9b66f8c6094f89350371ac7937de7c72.185.llvm.7519367550485861600 +1.77 KiB 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +17.0Ki  [NEW]     +76    anon.9b66f8c6094f89350371ac7937de7c72.830.llvm.7519367550485861600
  [NEW] +10.2Ki  [NEW]     +79    anon.9b66f8c6094f89350371ac7937de7c72.200.llvm.7519367550485861600
  [NEW] +9.61Ki  [NEW]     +91    anon.9b66f8c6094f89350371ac7937de7c72.816.llvm.7519367550485861600
  [NEW] +4.57Ki  [NEW]     +74    anon.9b66f8c6094f89350371ac7937de7c72.811.llvm.7519367550485861600
  [NEW] +3.65Ki  [NEW]     +16    anon.9b66f8c6094f89350371ac7937de7c72.28.llvm.7519367550485861600
  [NEW] +3.28Ki  [NEW]      +2    anon.9b66f8c6094f89350371ac7937de7c72.637.llvm.7519367550485861600
  [NEW] +2.83Ki  [NEW]     +76    anon.9b66f8c6094f89350371ac7937de7c72.826.llvm.7519367550485861600
  [NEW] +2.59Ki  [NEW]    +101    anon.9b66f8c6094f89350371ac7937de7c72.1055.llvm.7519367550485861600
  [NEW] +2.47Ki  [NEW]     +80    anon.9b66f8c6094f89350371ac7937de7c72.828.llvm.7519367550485861600
  [NEW] +1.77Ki  [NEW]     +95    anon.9b66f8c6094f89350371ac7937de7c72.185.llvm.7519367550485861600
  -0.1%    -258  [ = ]       0    [1151 Others]
  [DEL] -1.77Ki  [DEL]     -95    anon.9b66f8c6094f89350371ac7937de7c72.185.llvm.14734938299648409202
  [DEL] -2.47Ki  [DEL]     -80    anon.9b66f8c6094f89350371ac7937de7c72.828.llvm.14734938299648409202
  [DEL] -2.60Ki  [DEL]    -101    anon.9b66f8c6094f89350371ac7937de7c72.1055.llvm.14734938299648409202
  [DEL] -2.83Ki  [DEL]     -76    anon.9b66f8c6094f89350371ac7937de7c72.826.llvm.14734938299648409202
  [DEL] -3.28Ki  [DEL]      -2    anon.9b66f8c6094f89350371ac7937de7c72.637.llvm.14734938299648409202
  [DEL] -3.65Ki  [DEL]     -16    anon.9b66f8c6094f89350371ac7937de7c72.28.llvm.14734938299648409202
  [DEL] -4.58Ki  [DEL]     -74    anon.9b66f8c6094f89350371ac7937de7c72.811.llvm.14734938299648409202
  [DEL] -9.61Ki  [DEL]     -91    anon.9b66f8c6094f89350371ac7937de7c72.816.llvm.14734938299648409202
  [DEL] -10.2Ki  [DEL]     -79    anon.9b66f8c6094f89350371ac7937de7c72.200.llvm.14734938299648409202
  [DEL] -17.0Ki  [DEL]     -76    anon.9b66f8c6094f89350371ac7937de7c72.830.llvm.14734938299648409202
  -0.0%    -264  [ = ]       0    TOTAL

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

When PROTOC points to a compiler outside PATH, the helper sets its path but does not select the protoc parser. The build script fails before it invokes the compiler, so the hermetic-build case remains broken.

Open Bits AI session

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

Comment thread lib/protos/datadog/build.rs Outdated
@pr-commenter

pr-commenter Bot commented Aug 19, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: d6705047-6c48-4e46-82f8-6b8346d42c1d
Baseline: bfbd1687 · Comparison: b1bc60ba · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (5)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
quality_gates_rss_dsd_low memory ⚪ +0.42 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.26 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.13 metrics profiles logs
quality_gates_rss_idle memory ⚪ -0.50 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.83 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 227 MiB ≤ 250 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 51.4 MiB ≤ 60 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 90.4 MiB ≤ 100 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 392 MiB ≤ 420 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 31.7 MiB ≤ 40 MiB metrics profiles logs
Explanation

A change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression. Experiments tagged (no analysis) show ⚠️ n/a: SMP ran them but produced no analysis, usually because a replicate failed and exhausted its retries. Check the SMP report for that experiment's replicate failures.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit d7046b3 into main Aug 19, 2026
103 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the ilya/honor-protoc-env branch August 19, 2026 22:20
dd-octo-sts Bot pushed a commit that referenced this pull request Aug 19, 2026
## Summary

Use the conventional `PROTOC` environment variable for the `protobuf-codegen` invocations in `datadog-protos` when it is set. Continue searching `PATH` when it is unset so existing Cargo builds keep working.

Also declare `PROTOC` as a build-script input so Cargo reruns code generation when it changes.

This allows hermetic build systems such as Bazel to provide an explicitly declared compiler instead of requiring `protoc` on the host `PATH`.

## Change Type
- [x] Bug fix
- [ ] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance

## How did you test this PR?

Ran the `datadog-protos` check both with an explicit compiler and with the existing `PATH` fallback:

```console
PROTOC=/opt/homebrew/bin/protoc cargo check -p datadog-protos
env -u PROTOC cargo check -p datadog-protos
```

Co-authored-by: ilya.rubnich <ilya.rubnich@datadoghq.com> d7046b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/io General I/O and networking. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants