Skip to content

Build Go binaries with Bazel toolchains when available - #59875

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
regis.desgroppes/homogeneous-go-build
Nov 10, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
regis.desgroppes/homogeneous-go-build

Conversation

@rdesgroppes

@rdesgroppes rdesgroppes commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Make go_build run bazel run @rules_go//go -- for every backend but msgo, which keeps bazel run //:msgo --, instead of the go preinstalled in build images, keeping that go only where Bazel is missing, such as on AIX and in the Docker images building the OTel agent.
To that end:

  • make get_build_flags pin GOARCH=arm and CGO_ENABLED=1 when a 32-bit userland runs on a 64-bit ARM kernel, as in the armhf build image, since Bazel's Go SDK follows that kernel, and its builds for 32-bit ARM, being cross-builds, would otherwise disable cgo,
  • give the host-profiler jobs the Bazel CI setup their builds now need.

Motivation

#58530 moved the msgo builds of go_build to Bazel's msgo, but left the other builds on the go of build images, and its review asked to route them all through Bazel, fips_backend picking //:msgo or the plain Bazel go, which would also simplify go_build.
Doing so there would have broken the armhf build, the host-profiler jobs and the Bazel-less Docker builds, so it was agreed to leave the non-FIPS path to a follow-up, which first lifts those blockers.
Every Go build then uses a toolchain pinned like the other Bazel ones, rather than one coming with the image.

Describe how you validated your changes

With upstream Go as the go on PATH, checked that:

  • a go_build with check_deadcode builds through @rules_go//go and feeds its -dumpdep output to whydeadcode,
  • dda inv -- -e agent.build --build-exclude=systemd builds with @rules_go//go, cgo included,
  • dda inv -- -e secret-generic-connector.build with --fips-backend=boringcrypto builds with @rules_go//go, recording GOEXPERIMENT=boringcrypto and linking BoringSSL (_Cfunc__goboringcrypto_ symbols),
  • without bazelisk on PATH, go_build builds with the go on PATH and skips check_deadcode with a warning, whydeadcode itself running through Bazel,
  • the armhf build produces a 32-bit ARM agent with GOARCH=arm and CGO_ENABLED=1.

Additional Notes

The armhf pin doesn't apply where libfakearmv7l.so spoofs uname as armv7l, which only iot_agent_rpm-armhf does, without building Go code.
get_build_flags's platform parameter becomes target_platform, the name of the variable agent.build, its only user, passes to it, so as to stop shadowing the platform module.

@rdesgroppes rdesgroppes added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Nov 6, 2026
@github-actions github-actions Bot added the medium review PR review might take time label Nov 6, 2026

@github-actions github-actions Bot 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.

AI review by Codex (OpenAI) - workflow run

The patch is correct based on static review. No actionable issues were identified. Unit tests could not run because the environment lacks the Python invoke dependency; platform builds remain unverified.

@dd-octo-sts

dd-octo-sts Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Gitlab CI Configuration Changes

Modified Jobs

.build_host_profiler_binary_common
  .build_host_profiler_binary_common:
    artifacts:
      expire_in: 1 day
      paths:
      - $CI_PROJECT_DIR/bin/host-profiler/host-profiler
+   cache:
+   - key:
+       files:
+       - .bazelversion
+       prefix: bazelversion-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazelisk
+     - .cache/bazel/*/install
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   - key:
+       files:
+       - MODULE.bazel.lock
+       prefix: bazel-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazel/*/cache
+     - .cache/go/mod/cache
+     - .cache/golangci-lint
+     - .cache/pip
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   id_tokens:
+     BUILDBARN_ID_TOKEN:
+       aud: buildbarn.us1.ddbuild.io
+     CI_IDENTITIES_GITLAB_ID_TOKEN:
+       aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - setup_agent_version
    - go_deps
    rules:
    - when: on_success
    script:
    - . tools/ci/sanitize-goproxy.sh
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - dda inv -- -e host-profiler.build
    stage: binary_build
    timeout: 25m
    variables:
+     BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      GIT_DEPTH: 0
+     KUBERNETES_CPU_LIMIT: 16
+     KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
+     XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
build_host_profiler_binary_arm64
  build_host_profiler_binary_arm64:
    artifacts:
      expire_in: 1 day
      paths:
      - $CI_PROJECT_DIR/bin/host-profiler/host-profiler
+   cache:
+   - key:
+       files:
+       - .bazelversion
+       prefix: bazelversion-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazelisk
+     - .cache/bazel/*/install
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   - key:
+       files:
+       - MODULE.bazel.lock
+       prefix: bazel-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazel/*/cache
+     - .cache/go/mod/cache
+     - .cache/golangci-lint
+     - .cache/pip
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   id_tokens:
+     BUILDBARN_ID_TOKEN:
+       aud: buildbarn.us1.ddbuild.io
+     CI_IDENTITIES_GITLAB_ID_TOKEN:
+       aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - setup_agent_version
    - go_deps
    rules:
    - when: on_success
    script:
    - . tools/ci/sanitize-goproxy.sh
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - dda inv -- -e host-profiler.build
    stage: binary_build
    tags:
    - arch:arm64
    - specific:true
    timeout: 25m
    variables:
+     BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      GIT_DEPTH: 0
+     KUBERNETES_CPU_LIMIT: 16
+     KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
+     XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
build_host_profiler_binary_x64
  build_host_profiler_binary_x64:
    artifacts:
      expire_in: 1 day
      paths:
      - $CI_PROJECT_DIR/bin/host-profiler/host-profiler
+   cache:
+   - key:
+       files:
+       - .bazelversion
+       prefix: bazelversion-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazelisk
+     - .cache/bazel/*/install
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   - key:
+       files:
+       - MODULE.bazel.lock
+       prefix: bazel-$CI_RUNNER_DESCRIPTION
+     paths:
+     - .cache/bazel/*/cache
+     - .cache/go/mod/cache
+     - .cache/golangci-lint
+     - .cache/pip
+     policy: pull$BAZEL_CACHE_POLICY_SUFFIX
+     when: on_success
+   id_tokens:
+     BUILDBARN_ID_TOKEN:
+       aud: buildbarn.us1.ddbuild.io
+     CI_IDENTITIES_GITLAB_ID_TOKEN:
+       aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - setup_agent_version
    - go_deps
    rules:
    - when: on_success
    script:
    - . tools/ci/sanitize-goproxy.sh
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - dda inv -- -e host-profiler.build
    stage: binary_build
    tags:
    - arch:amd64
    - specific:true
    timeout: 25m
    variables:
+     BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      GIT_DEPTH: 0
+     KUBERNETES_CPU_LIMIT: 16
+     KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
+     XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache

Changes Summary

Removed Modified Added Renamed
0 3 0 0

ℹ️ Diff available in the job log.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 66.82% (+0.00%)

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

@dd-octo-sts

dd-octo-sts Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 48085a5
📊 Static Quality Gates Dashboard
🔗 SQG Job

Successful checks

Info

Quality gate Change Size (prev → curr → max)
✅ iot_agent_deb_armhf -32.0 KiB (0.07% reduction, +33.85% of buffer) 45.588 → 45.556 → 45.680
32 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
✅ agent_deb_amd64 765.528 MiB
✅ agent_deb_amd64_fips 696.083 MiB
✅ agent_heroku_amd64 313.985 MiB
✅ agent_msi 671.417 MiB
✅ agent_rpm_amd64 765.511 MiB
✅ agent_rpm_amd64_fips 696.066 MiB
✅ agent_rpm_arm64 734.747 MiB
✅ agent_rpm_arm64_fips 671.135 MiB
✅ agent_suse_amd64 765.511 MiB
✅ agent_suse_amd64_fips 696.066 MiB
✅ agent_suse_arm64 734.747 MiB
✅ agent_suse_arm64_fips 671.135 MiB
✅ docker_agent_amd64 821.192 MiB
✅ docker_agent_arm64 815.106 MiB
✅ docker_agent_jmx_amd64 1012.121 MiB
✅ docker_agent_jmx_arm64 994.751 MiB
✅ docker_cws_instrumentation_amd64 9.513 MiB
✅ docker_cws_instrumentation_arm64 8.877 MiB
✅ docker_dogstatsd_amd64 40.310 MiB
✅ docker_dogstatsd_arm64 38.333 MiB
✅ docker_host_profiler_amd64 282.552 MiB
✅ docker_host_profiler_arm64 295.260 MiB
✅ dogstatsd_deb_amd64 31.066 MiB
✅ dogstatsd_deb_arm64 28.980 MiB
✅ dogstatsd_rpm_amd64 31.066 MiB
✅ dogstatsd_suse_amd64 31.066 MiB
✅ iot_agent_deb_amd64 48.413 MiB
✅ iot_agent_deb_arm64 44.782 MiB
✅ iot_agent_rpm_amd64 48.413 MiB
✅ iot_agent_suse_amd64 48.412 MiB
✅ docker_cluster_agent_amd64 218.144 MiB
✅ docker_cluster_agent_arm64 230.855 MiB

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Job ID: cbf5ec67-439f-42db-b943-4e8494a3e812

Baseline: 5a49007
Comparison: f7caf7e
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
➖ dsd_uds_client_drop_detector_cpu % cpu utilization +2.57 [+2.02, +3.13] 1 Logs
➖ quality_gate_logs % cpu utilization +1.06 [+0.13, +1.98] 1 Logs bounds checks dashboard
➖ quality_gate_metrics_logs memory utilization +0.93 [+0.71, +1.16] 1 Logs bounds checks dashboard
➖ quality_gate_idle_all_features memory utilization +0.25 [+0.18, +0.33] 1 Logs bounds checks dashboard
➖ dsd_uds_10mb_3k_timestamped_contexts_cpu % cpu utilization +0.22 [-0.04, +0.48] 1 Logs
➖ quality_gate_private_action_runner memory utilization +0.05 [-0.09, +0.18] 1 Logs bounds checks dashboard
➖ python_openmetrics % cpu utilization -0.04 [-0.69, +0.60] 1 Logs bounds checks dashboard
➖ quality_gate_security_no_fs_load memory utilization -0.17 [-0.23, -0.10] 1 Logs bounds checks dashboard
➖ quality_gate_idle memory utilization -0.21 [-0.25, -0.16] 1 Logs bounds checks dashboard
➖ quality_gate_security_idle memory utilization -0.24 [-0.29, -0.20] 1 Logs bounds checks dashboard
➖ quality_gate_security_mean_fs_load memory utilization -0.35 [-0.39, -0.31] 1 Logs bounds checks dashboard
➖ dsd_uds_10mb_3k_timestamped_contexts_memory memory utilization -0.73 [-0.95, -0.51] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
✅ python_openmetrics checks_execution_time 10/10 77.52 ≤ 100 bounds checks dashboard
✅ python_openmetrics cpu_usage 10/10 1343.04 ≤ 1500 bounds checks dashboard
✅ python_openmetrics memory_usage 10/10 4.31GiB ≤ 4.75GiB bounds checks dashboard
✅ quality_gate_idle intake_connections 10/10 5 ≤ 5 bounds checks dashboard
✅ quality_gate_idle memory_usage 10/10 181.64MiB ≤ 190MiB bounds checks dashboard
✅ quality_gate_idle total_bytes_received 10/10 779.67KiB ≤ 819.20KiB bounds checks dashboard
✅ quality_gate_idle_all_features intake_connections 10/10 2 ≤ 5 bounds checks dashboard
✅ quality_gate_idle_all_features memory_usage 10/10 477.09MiB ≤ 544MiB bounds checks dashboard
✅ quality_gate_idle_all_features total_bytes_received 10/10 1.17MiB ≤ 1.25MiB bounds checks dashboard
✅ quality_gate_logs intake_connections 10/10 17 ≤ 40 bounds checks dashboard
✅ quality_gate_logs memory_usage 10/10 220.56MiB ≤ 234MiB bounds checks dashboard
✅ quality_gate_logs missed_bytes 10/10 0B ≤ 0B bounds checks dashboard
✅ quality_gate_logs total_bytes_received 10/10 263.95MiB ≤ 292MiB bounds checks dashboard
✅ quality_gate_metrics_logs cpu_usage 10/10 365.49 ≤ 2000 bounds checks dashboard
✅ quality_gate_metrics_logs intake_connections 10/10 20 ≤ 40 bounds checks dashboard
✅ quality_gate_metrics_logs memory_usage 10/10 439.37MiB ≤ 463MiB bounds checks dashboard
✅ quality_gate_metrics_logs missed_bytes 10/10 0B ≤ 0B bounds checks dashboard
✅ quality_gate_metrics_logs total_bytes_received 10/10 961.47MiB ≤ 1.04GiB bounds checks dashboard
✅ quality_gate_private_action_runner memory_usage 10/10 75.99MiB ≤ 78MiB bounds checks dashboard
✅ quality_gate_security_idle cpu_usage 10/10 26.22 ≤ 100 bounds checks dashboard
✅ quality_gate_security_idle memory_usage 10/10 340.08MiB ≤ 365MiB bounds checks dashboard
✅ quality_gate_security_mean_fs_load cpu_usage 10/10 39.13 ≤ 200 bounds checks dashboard
✅ quality_gate_security_mean_fs_load memory_usage 10/10 314.20MiB ≤ 343MiB bounds checks dashboard
✅ quality_gate_security_no_fs_load cpu_usage 10/10 22.89 ≤ 100 bounds checks dashboard
✅ quality_gate_security_no_fs_load memory_usage 10/10 316.48MiB ≤ 356MiB bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

✅ Passed. All Quality Gates passed.

  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_private_action_runner, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_no_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_no_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/homogeneous-go-build branch from afcd2b1 to d31b0c2 Compare November 8, 2026 17:32
### What does this PR do?

Make `go_build` run `bazel run @rules_go//go --` for every backend but
`msgo`, which keeps `bazel run //:msgo --`, instead of the `go`
preinstalled in build images, keeping that `go` only where Bazel is
missing, such as on AIX and in the Docker images building the OTel
agent.
To that end:
- make `get_build_flags` pin `GOARCH=arm` and `CGO_ENABLED=1` when a
  32-bit userland runs on a 64-bit ARM kernel, as in the armhf build
  image, since Bazel's Go SDK follows that kernel, and its builds for
  32-bit ARM, being cross-builds, would otherwise disable cgo,
- give the host-profiler jobs the Bazel CI setup their builds now need.

### Motivation

#58530 moved the `msgo` builds of `go_build` to Bazel's `msgo`, but left
the other builds on the `go` of build images, and its review asked to
route them all through Bazel, `fips_backend` picking `//:msgo` or the
plain Bazel `go`, which would also simplify `go_build`.
Doing so there would have broken the armhf build, the host-profiler jobs
and the Bazel-less Docker builds, so it was agreed to leave the non-FIPS
path to this follow-up, which first lifts those blockers.
Every Go build then uses a toolchain pinned like the other Bazel ones,
rather than one coming with the image.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- a `go_build` with `check_deadcode` builds through `@rules_go//go` and
  feeds its `-dumpdep` output to `whydeadcode`,
- `dda inv -- -e agent.build --build-exclude=systemd` builds with
  `@rules_go//go`, cgo included,
- `dda inv -- -e secret-generic-connector.build` with
  `--fips-backend=boringcrypto` builds with `@rules_go//go`, recording
  `GOEXPERIMENT=boringcrypto` and linking BoringSSL
  (`_Cfunc__goboringcrypto_` symbols),
- without `bazelisk` on `PATH`, `go_build` builds with the `go` on
  `PATH` and skips `check_deadcode` with a warning, `whydeadcode` itself
  running through Bazel,
- the armhf build produces a 32-bit ARM agent with `GOARCH=arm` and
  `CGO_ENABLED=1`.

### Additional Notes

`@rules_go//go` is the official, statically linked `go`, unlike the
`go_fast` behind `//:go`, whose cgo would depend on the host C
toolchain, which the armhf image's 32-bit one cannot serve.
The armhf agent's Go code moves from the `GOARM=6` of the image's own
`go`, a `linux-armv6l` release, to Go's cross-build default `GOARM=7`,
the ARMv7 that its C code (ELF `Tag_CPU_arch: v7`) and the IoT Agent's
documented support already require.
The armhf pin doesn't apply where `libfakearmv7l.so` spoofs `uname` as
`armv7l`, which only `iot_agent_rpm-armhf` does, without building Go
code.
`get_build_flags`'s `platform` parameter becomes `target_platform`, the
name of the variable `agent.build`, its only user, passes to it, so as
to stop shadowing the `platform` module.
@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/homogeneous-go-build branch from d31b0c2 to b3cf902 Compare November 10, 2026 12:57
@rdesgroppes
rdesgroppes marked this pull request as ready for review November 10, 2026 13:02
@rdesgroppes
rdesgroppes requested review from a team as code owners November 10, 2026 13:02
@rdesgroppes
rdesgroppes requested a review from fabbing November 10, 2026 13:02

@github-actions github-actions Bot 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.

AI review by Codex (OpenAI) - workflow run

The patch is correct. No actionable regressions were identified in the diff or affected build paths. Unit tests could not run because the environment lacks the Python invoke dependency.

@rdesgroppes rdesgroppes changed the title Build every Go binary with the Bazel Go toolchains Build every Go binary with the Bazel Go toolchains when available Nov 10, 2026
@rdesgroppes rdesgroppes changed the title Build every Go binary with the Bazel Go toolchains when available Build Go binaries with the Bazel Go toolchains when available Nov 10, 2026
@rdesgroppes rdesgroppes changed the title Build Go binaries with the Bazel Go toolchains when available Build Go binaries with Bazel Go toolchains when available Nov 10, 2026
@rdesgroppes rdesgroppes changed the title Build Go binaries with Bazel Go toolchains when available Build Go binaries with Bazel toolchains when available Nov 10, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit f7caf7e into main Nov 10, 2026
319 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the regis.desgroppes/homogeneous-go-build branch November 10, 2026 16:30
@github-actions github-actions Bot added this to the 7.87.0 milestone Nov 10, 2026
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<arch>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
rdesgroppes added a commit that referenced this pull request Nov 11, 2026
### What does this PR do?

Request FIPS builds with
`--platforms=//bazel/platforms:<os>_<cpu>_fips`, whose `flags` select
the `msgo` SDK, instead of the retired `fips` value of
`//packages/agent:flavor`.
Key the FIPS `config_setting`s, `@openssl`'s and the FIPS package names
on the `//bazel/platforms:fips` constraint, and have the omnibus helpers
pass the FIPS platform.
Register a test toolchain so that `bazel test` works on FIPS platforms,
and remove the unused macOS FIPS platforms.
Have the installer's symbol test require `msgo`'s OpenSSL or CNG
backend on the Linux or Windows FIPS platforms, and reject it elsewhere.
This doesn't cover the RUNPATH of the OpenSSL that Bazel-built FIPS
binaries load, nor lifting the #59511 refusal, which depends on it.

### Motivation

The FIPS platforms' constraint selected nothing, and the `fips` flavor
selected the FIPS tags but kept the upstream SDK, both silently
producing non-FIPS binaries, which #59511 had to refuse.
Since #58511 made `msgo` a toolchain, a platform can carry both the
constraint and the SDK choice.

### Describe how you validated your changes

- `//cmd/agent` builds with `msgo` and the FIPS tags on the FIPS
  platforms, `requirefips` being Linux-only, and with the upstream SDK
  and no FIPS tags on the others,
- the agent, installer, loader and packaging targets, and `@openssl`,
  analyze with no ambiguous `select()` on the Linux and Windows
  platforms, FIPS or not,
- `bazel test` passes on a FIPS platform,
- the installer's symbol test passes on the Linux and Windows FIPS
  platforms, and fails when expecting a package the binary lacks.

### Additional Notes

The FIPS platforms set `sdk_name` through `platform(flags = ...)`,
because deriving it from the constraint would take patching rules_go's
`go_transition` or duplicating its `toolchain()` matrix.
The retired flavor value now fails the analysis of packaging targets.
`//cmd/dogstatsd` drops its `cgo` select, whose FIPS branch was a no-op,
#58511's `msgo` SDK building its OpenSSL backend without cgo through
`ms_nocgo_opensslcrypto`, the default of `msgo` 1.27
(https://devblogs.microsoft.com/go/go-1-27-0-1-microsoft-build-now-available/),
leaving `dd_agent_go_binary`'s identical default.
`//cmd/loader:trace_loader_all_files` only excludes Windows, like
`:loader`, instead of listing Linux and macOS.
Prerequisites:
- #56351
- #56865
- #57078
- #57223
- #58511
- #58530
- #59501
- #59511
- #59840
- #59871
- #59875
- #60181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed internal Identify a non-fork PR medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/agent-build team/agent-devx team/agent-runtimes team/profiling-full-host

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants