Skip to content

[ABLD-525] Point Bazel-built FIPS Go binaries to the embedded OpenSSL - #60334

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
regis.desgroppes/abld-525-fips-openssl-runpath
Nov 13, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
regis.desgroppes/abld-525-fips-openssl-runpath

Conversation

@rdesgroppes

@rdesgroppes rdesgroppes commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Give Linux FIPS Go binaries a RUNPATH to their embedded libraries with Go's -r in dd_agent_go_binary, so that msgo loads the embedded OpenSSL.

For "versioned" install directories, as under datadog-packages, have that RUNPATH fall back to the "stable" version's libraries, for the installer, which an upgrade runs before its version is unpacked.

This is the last prerequisite to lifting #59511's guard against Bazel-built FIPS binaries, which #60204 will do.

Motivation

Bazel-built FIPS binaries had no RUNPATH to the embedded libraries, so msgo dlopened OpenSSL from the default search path, loading the system one (or panicking without one).

Omnibus' CGO_LDFLAGS, whose -rpath the external linker honors for cgo binaries, never reach Bazel, whose own rpath only lists its $ORIGIN-relative solib directories, while Go's internal linker, which cgo-less binaries go through, ignores such flags anyway.

Go's -r sets the search path whichever linker writes it, as #56351 does for the omnibus-built installer, listing both directories since #57045's patchelf --set-rpath of the bootstrap copy segfaults on such a binary:

💡 the PR/commit is therefore meant to be reverted when patchelf no longer exhibits the issue.

Describe how you validated your changes

  • the FIPS installer has <install_dir>/embedded/lib as DT_RUNPATH and loads libcrypto.so.3 from there,
  • in a versioned install directory, its RUNPATH then lists the stable version's libraries, from which it loads libcrypto.so.3 when its own version lacks it,
  • the FIPS agent uses cgo for rtloader, so the external linker writes its rpath: those directories come first, then Bazel's solib ones,
  • replace_prefix, which --enable-bazel agent builds run, keeps <install_dir>/embedded/lib in that rpath,
  • non-FIPS binaries keep their RUNPATH.

Additional Notes

The RUNPATH comes from an EMBEDDED_LIB_DIRS make variable of //bazel/rules/variables, which already derives AGENT_PACKAGE_VERSION from the install directory.

@rdesgroppes
rdesgroppes requested a review from a team as a code owner November 12, 2026 18:13
@rdesgroppes rdesgroppes added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Nov 12, 2026
@dd-octo-sts dd-octo-sts Bot added internal Identify a non-fork PR team/agent-build labels Nov 12, 2026
@github-actions github-actions Bot added the medium review PR review might take time label Nov 12, 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. No actionable issues found in the diff. The Linux FIPS linker flags use the shared embedded-library paths and add the stable fallback for versioned installs. Build and runtime validation were not run in this read-only environment.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/abld-525-fips-openssl-runpath branch from 03468b9 to 30ca43e Compare November 12, 2026 18:32
@dd-octo-sts

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

Copy link
Copy Markdown
Contributor

Static quality checks

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

33 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
✅ agent_deb_amd64 766.418 MiB
✅ agent_deb_amd64_fips 696.874 MiB
✅ agent_heroku_amd64 314.511 MiB
✅ agent_msi 669.431 MiB
✅ agent_rpm_amd64 766.394 MiB
✅ agent_rpm_amd64_fips 696.850 MiB
✅ agent_rpm_arm64 735.510 MiB
✅ agent_rpm_arm64_fips 671.752 MiB
✅ agent_suse_amd64 766.394 MiB
✅ agent_suse_amd64_fips 696.850 MiB
✅ agent_suse_arm64 735.510 MiB
✅ agent_suse_arm64_fips 671.752 MiB
✅ docker_agent_amd64 822.136 MiB
✅ docker_agent_arm64 815.989 MiB
✅ docker_agent_jmx_amd64 1013.065 MiB
✅ docker_agent_jmx_arm64 995.634 MiB
✅ docker_cws_instrumentation_amd64 9.513 MiB
✅ docker_cws_instrumentation_arm64 8.877 MiB
✅ docker_dogstatsd_amd64 40.342 MiB
✅ docker_dogstatsd_arm64 38.334 MiB
✅ docker_host_profiler_amd64 282.607 MiB
✅ docker_host_profiler_arm64 295.340 MiB
✅ dogstatsd_deb_amd64 31.094 MiB
✅ dogstatsd_deb_arm64 29.005 MiB
✅ dogstatsd_rpm_amd64 31.094 MiB
✅ dogstatsd_suse_amd64 31.094 MiB
✅ iot_agent_deb_amd64 48.429 MiB
✅ iot_agent_deb_arm64 44.795 MiB
✅ iot_agent_deb_armhf 45.573 MiB
✅ iot_agent_rpm_amd64 48.430 MiB
✅ iot_agent_suse_amd64 48.429 MiB
✅ docker_cluster_agent_amd64 218.389 MiB
✅ docker_cluster_agent_arm64 231.112 MiB

@cit-pr-commenter-54b7da

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

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Job ID: 4cab2c35-9145-427f-a88c-6a6eaf3edd95

Baseline: fa3b80c
Comparison: 47fbd11
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
➖ quality_gate_security_mean_fs_load memory utilization +0.50 [+0.46, +0.53] 1 Logs bounds checks dashboard
➖ dsd_uds_10mb_3k_timestamped_contexts_cpu % cpu utilization +0.47 [+0.21, +0.74] 1 Logs
➖ quality_gate_private_action_runner memory utilization +0.44 [+0.32, +0.56] 1 Logs bounds checks dashboard
➖ quality_gate_idle_all_features memory utilization +0.31 [+0.27, +0.36] 1 Logs bounds checks dashboard
➖ quality_gate_logs % cpu utilization +0.28 [-0.61, +1.18] 1 Logs bounds checks dashboard
➖ python_openmetrics % cpu utilization -0.14 [-0.80, +0.52] 1 Logs bounds checks dashboard
➖ quality_gate_idle memory utilization -0.15 [-0.19, -0.10] 1 Logs bounds checks dashboard
➖ quality_gate_security_idle memory utilization -0.26 [-0.30, -0.22] 1 Logs bounds checks dashboard
➖ quality_gate_security_no_fs_load memory utilization -0.30 [-0.37, -0.23] 1 Logs bounds checks dashboard
➖ quality_gate_metrics_logs memory utilization -0.49 [-0.72, -0.26] 1 Logs bounds checks dashboard
➖ dsd_uds_client_drop_detector_cpu % cpu utilization -0.79 [-1.34, -0.23] 1 Logs
➖ dsd_uds_10mb_3k_timestamped_contexts_memory memory utilization -0.93 [-1.14, -0.71] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
✅ python_openmetrics checks_execution_time 10/10 75.02 ≤ 100 bounds checks dashboard
✅ python_openmetrics cpu_usage 10/10 1348.17 ≤ 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 ≤ 6 bounds checks dashboard
✅ quality_gate_idle memory_usage 10/10 187.60MiB ≤ 190MiB bounds checks dashboard
✅ quality_gate_idle total_bytes_received 10/10 767.93KiB ≤ 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 458.54MiB ≤ 544MiB bounds checks dashboard
✅ quality_gate_idle_all_features total_bytes_received 10/10 1.16MiB ≤ 1.25MiB bounds checks dashboard
✅ quality_gate_logs intake_connections 10/10 16 ≤ 40 bounds checks dashboard
✅ quality_gate_logs memory_usage 10/10 221.40MiB ≤ 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.75MiB ≤ 292MiB bounds checks dashboard
✅ quality_gate_metrics_logs cpu_usage 10/10 363.80 ≤ 2000 bounds checks dashboard
✅ quality_gate_metrics_logs intake_connections 10/10 19 ≤ 40 bounds checks dashboard
✅ quality_gate_metrics_logs memory_usage 10/10 426.14MiB ≤ 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 953.41MiB ≤ 1.04GiB bounds checks dashboard
✅ quality_gate_private_action_runner memory_usage 10/10 77.13MiB ≤ 78MiB bounds checks dashboard
✅ quality_gate_security_idle cpu_usage 10/10 28.09 ≤ 100 bounds checks dashboard
✅ quality_gate_security_idle memory_usage 10/10 332.92MiB ≤ 365MiB bounds checks dashboard
✅ quality_gate_security_mean_fs_load cpu_usage 10/10 39.75 ≤ 200 bounds checks dashboard
✅ quality_gate_security_mean_fs_load memory_usage 10/10 315.37MiB ≤ 343MiB bounds checks dashboard
✅ quality_gate_security_no_fs_load cpu_usage 10/10 23.14 ≤ 100 bounds checks dashboard
✅ quality_gate_security_no_fs_load memory_usage 10/10 320.79MiB ≤ 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.

Comment thread bazel/rules/go/go_binary.bzl Resolved
### What does this PR do?
Give Linux FIPS Go binaries a RUNPATH to their embedded libraries with
Go's `-r` in `dd_agent_go_binary`, so that `msgo` loads the embedded
OpenSSL.

For "versioned" install directories, as under `datadog-packages`, have
that RUNPATH fall back to the "stable" version's libraries, for the
installer, which an upgrade runs _before its version is unpacked_.

:bulb: This is the last prerequisite to lifting #59511's guard against
Bazel-built FIPS binaries, which #60204 will do.

### Motivation
Bazel-built FIPS binaries had no RUNPATH to the embedded libraries, so
`msgo` `dlopen`ed OpenSSL from the default search path, loading the
**system** one (or panicking without one).

Omnibus' `CGO_LDFLAGS`, whose `-rpath` the external linker honors for
cgo binaries, never reach Bazel, whose own rpath only lists its
`$ORIGIN`-relative solib directories, while Go's internal linker, which
cgo-less binaries go through, ignores such flags anyway.

Go's `-r` sets the search path whichever linker writes it, as #56351
does for the omnibus-built installer, listing both directories since
#57045's `patchelf --set-rpath` of the bootstrap copy **segfaults** on
such a binary once stripped.

### Describe how you validated your changes
- the FIPS installer has `<install_dir>/embedded/lib` as `DT_RUNPATH`
  and loads `libcrypto.so.3` from there,
- in a versioned install directory, its RUNPATH then lists the stable
  version's libraries, from which it loads `libcrypto.so.3` when its own
  version lacks it,
- the FIPS agent uses cgo for `rtloader`, so the external linker writes
  its rpath: those directories come first, then Bazel's solib ones,
- `replace_prefix`, which `--enable-bazel` agent builds run, keeps
  `<install_dir>/embedded/lib` in that rpath,
- non-FIPS binaries keep their RUNPATH.

### Additional Notes
The RUNPATH comes from an `EMBEDDED_LIB_DIRS` make variable of
`//bazel/rules/variables`, which already derives `AGENT_PACKAGE_VERSION`
from the install directory.
#60334 (comment)
> As discussed offline, this is inconsistent with the overall policy of
> delaying rpath setting to the last moment via patchelf. It's fine if
> we land it like this (due to the patchelf bug you described), but we
> should at some point strive to make things consistent; and in the
> meantime a somewhat longer comment explaining the reason why we're
> doing this here.
=> `dd_agent_go_binary` now explains why Linux FIPS binaries get their
rpath at link time rather than through packaging's `patchelf` rewrite,
and lists the upstream patchelf reports and fixes.
@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/abld-525-fips-openssl-runpath branch from 30ca43e to b85a958 Compare November 13, 2026 10:42
#60334 (comment)
> 👍 Thanks (though as a nit I'll say that the comment should probably be
> closer to the line with the `-r`).
=> The comment now sits right above the `-r` it explains.
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 47fbd11 into main Nov 13, 2026
289 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the regis.desgroppes/abld-525-fips-openssl-runpath branch November 13, 2026 12:35
@github-actions github-actions Bot added this to the 7.87.0 milestone Nov 13, 2026
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through a `fips_backend`
of `bazel()` and `build_binary_with_bazel`, which selects the FIPS
target platform, instead of failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus sets, every omnibus build task already receiving its FIPS option
explicitly, and make it fail hard instead when a call doesn't pass the
`msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches,
including `go_build`'s, which then always runs `@rules_go//go`, the FIPS
target platform selecting `msgo`.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

Explicit is better than implicit: the task that knows it builds FIPS
says so, rather than every `bazel()` call guessing it from the
environment.

### Describe how you validated your changes
- `installer.build --enable-bazel --fips-backend msgo`, and
  `process-agent.build` and `privateactionrunner.build` with
  `--enable-bazel --flavor fips`, build `msgo` FIPS binaries without
  `AGENT_FLAVOR`, the FIPS target platform applying to both their
  `build` and `cquery`,
- `--fips-backend boringcrypto` still fails,
- `bazel()` selects the FIPS target platform for the `msgo` backend
  only, and fails on `AGENT_FLAVOR=fips` without it, as
  `dogstatsd.build` then shows,
- `installer.build --fips-backend msgo` with `AGENT_FLAVOR=fips`, as
  omnibus runs it, still builds through `@rules_go//go` a binary with
  `msgo`'s OpenSSL backend,
- the `bazel()` calls FIPS omnibus builds reach, which `go_build`,
  `schema.compress`, `build_libpcap` and the Windows resource helpers
  make, pass the build's backend.

### Additional Notes
`agent.build`, `process-agent.build`, `otel-agent.build` and
`privateactionrunner.build` pass their flavor's backend,
`process-agent.build` and `otel-agent.build` no longer passing a
`//packages/agent:flavor` their targets don't read, which `bazel()` adds
from `AGENT_FLAVOR` anyway.

`agent.build` also passes it to `rtloader.install-with-bazel`, so that
local FIPS builds get FIPS `rtloader` and CPython.

`build_binary_with_bazel` now rejects `boringcrypto`, which `go_build`
keeps running through the upstream `go` tool.

`//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo` of
`@msgo` go away, omnibus' FIPS symbol check running
`@rules_go//go tool nm` with the FIPS target platform its
`omnibazel_flags` already carry.
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through a `fips_backend`
of `bazel()` and `build_binary_with_bazel`, which selects the FIPS
target platform, instead of failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus sets, every omnibus build task already receiving its FIPS option
explicitly, and make it fail hard instead when a call doesn't pass the
`msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.
`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than discard Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

Explicit is better than implicit: the task that knows it builds FIPS
says so, rather than every `bazel()` call guessing it from the
environment.
Developers then get exactly what their CLI arguments request, whatever
their environment.

### Describe how you validated your changes
- `installer.build --enable-bazel --fips-backend msgo`, and
  `process-agent.build` and `privateactionrunner.build` with
  `--enable-bazel --flavor fips`, build `msgo` FIPS binaries without
  `AGENT_FLAVOR`, the FIPS target platform applying to both their
  `build` and `cquery`,
- `--fips-backend boringcrypto` still fails,
- `bazel()` selects the FIPS target platform for the `msgo` backend
  only, and fails on `AGENT_FLAVOR=fips` without it, as
  `dogstatsd.build` then shows,
- `installer.build --fips-backend msgo` with `AGENT_FLAVOR=fips`, as
  omnibus runs it, still builds through `@rules_go//go` a binary with
  `msgo`'s OpenSSL backend,
- the `bazel()` calls FIPS omnibus builds reach, which `go_build`,
  `schema.compress`, `build_libpcap`, `build_object_files` and the
  Windows resource helpers make, pass the build's backend.

### Additional Notes
`agent.build`, `process-agent.build`, `otel-agent.build` and
`privateactionrunner.build` pass their flavor's backend,
`process-agent.build` and `otel-agent.build` no longer passing a
`//packages/agent:flavor` their targets don't read, which `bazel()` adds
from `AGENT_FLAVOR` anyway.

`agent.build` also passes it to `rtloader.install-with-bazel`, so that
local FIPS builds get FIPS `rtloader` and CPython.

`build_binary_with_bazel` now rejects `boringcrypto`, which `go_build`
keeps running through the upstream `go` tool.

`//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo` of
`@msgo` go away, omnibus' FIPS symbol check running
`@rules_go//go tool nm` with the FIPS target platform its
`omnibazel_flags` already carry.
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit
`fips_backend`, which selects the FIPS target platform, instead of
failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus still sets, every omnibus build task already receiving its FIPS
option explicitly, and make it fail hard instead when a call doesn't
pass the `msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.
`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than discard Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/):
the task that knows it builds FIPS says so, rather than every `bazel()`
call guessing it from the environment.
Developers then get exactly what their CLI arguments request, whatever
their environment.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`,
  `installer.build --fips-backend msgo`, and `process-agent.build` and
  `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS
  binaries, the FIPS target platform applying to both their `build` and
  `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with
  `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with
  `msgo`'s OpenSSL backend, and
  `secret-generic-connector.build --fips-backend boringcrypto`, as CI
  runs it, one with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo`
  backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's
  backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and
  `privateactionrunner.build` pass their flavor's backend, the 2nd and
  3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for
  local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which `go_build` selects through
  `GOEXPERIMENT` alone, passing no backend,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo`
  of `@msgo` go away, as they were transitional until a target platform
  selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm` with the FIPS
  target platform of its `omnibazel_flags`, whose
  `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`,
  the way rules_go means an SDK to be selected and its `go` tool run:
  https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit
`fips_backend`, which selects the FIPS target platform, instead of
failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus still sets, every omnibus build task already receiving its FIPS
option explicitly, and make it fail hard instead when a call doesn't
pass the `msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.
`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than discard Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/):
the task that knows it builds FIPS says so, rather than every `bazel()`
call guessing it from the environment.
Developers then get exactly what their CLI arguments request, whatever
their environment.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`,
  `installer.build --fips-backend msgo`, and `process-agent.build` and
  `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS
  binaries, the FIPS target platform applying to both their `build` and
  `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with
  `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with
  `msgo`'s OpenSSL backend, and
  `secret-generic-connector.build --fips-backend boringcrypto`, as CI
  runs it, one with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo`
  backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's
  backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and
  `privateactionrunner.build` pass their flavor's backend, the 2nd and
  3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for
  local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which `go_build` selects through
  `GOEXPERIMENT` alone, passing no backend,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo`
  of `@msgo` go away, as they were transitional until a target platform
  selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm` with the FIPS
  target platform of its `omnibazel_flags`, whose
  `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`,
  the way rules_go means an SDK to be selected and its `go` tool run:
  https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit
`fips_backend`, which selects the FIPS target platform, instead of
failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus still sets, every omnibus build task already receiving its FIPS
option explicitly, and make it fail hard instead when a call doesn't
pass the `msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.
`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than discard Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/):
the task that knows it builds FIPS says so, rather than every `bazel()`
call guessing it from the environment.
Developers then get exactly what their CLI arguments request, whatever
their environment.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`,
  `installer.build --fips-backend msgo`, and `process-agent.build` and
  `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS
  binaries, the FIPS target platform applying to both their `build` and
  `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with
  `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with
  `msgo`'s OpenSSL backend, and `cluster-agent.build` and
  `secret-generic-connector.build` with `--fips-backend boringcrypto`,
  as CI runs them, ones with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo`
  backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's
  backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and
  `privateactionrunner.build` pass their flavor's backend, the 2nd and
  3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for
  local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which `FipsBackend.for_bazel()`
  turns into no backend with a warning for `go_build`, whose
  `GOEXPERIMENT` alone selects it, and `schema.compress`,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo`
  of `@msgo` go away, as they were transitional until a target platform
  selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm` with the FIPS
  target platform of its `omnibazel_flags`, whose
  `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`,
  the way rules_go means an SDK to be selected and its `go` tool run:
  https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk
rdesgroppes added a commit that referenced this pull request Nov 13, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit
`fips_backend`, which selects the FIPS target platform, instead of
failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus still sets, every omnibus build task already receiving its FIPS
option explicitly, and make it fail hard instead when a call doesn't
pass the `msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.
`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than discard Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/):
the task that knows it builds FIPS says so, rather than every `bazel()`
call guessing it from the environment.
Developers then get exactly what their CLI arguments request, whatever
their environment.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`,
  `installer.build --fips-backend msgo`, and `process-agent.build` and
  `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS
  binaries, the FIPS target platform applying to both their `build` and
  `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with
  `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with
  `msgo`'s OpenSSL backend, and `cluster-agent.build` and
  `secret-generic-connector.build` with `--fips-backend boringcrypto`,
  as CI runs them, ones with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo`
  backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's
  backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and
  `privateactionrunner.build` pass their flavor's backend, the 2nd and
  3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for
  local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which
  `FipsBackend.strip_boringcrypto()` turns into no backend with a
  warning for `go_build`, whose `GOEXPERIMENT` alone selects it, and
  `schema.compress`,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo`
  of `@msgo` go away, as they were transitional until a target platform
  selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm` with the FIPS
  target platform of its `omnibazel_flags`, whose
  `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`,
  the way rules_go means an SDK to be selected and its `go` tool run:
  https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk
rdesgroppes added a commit that referenced this pull request Nov 16, 2026
…mode

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit
`fips_backend`, which selects the FIPS target platform, instead of
failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which
omnibus _still_ sets, every omnibus build task already receiving its
FIPS option explicitly, and make it fail hard instead when a call
doesn't pass the `msgo` backend, rather than silently building without
FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as
each got the FIPS target platform from `AGENT_FLAVOR` so far.

`go_build` needs it to get `msgo` from `@rules_go//go`, which it then
always runs, `cquery` and `info` to locate what `build` produced for
that platform, and the other calls to share the configuration of `build`
rather than thrashing Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were
silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL,
which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/):
the task that knows it builds FIPS says so, rather than every `bazel()`
call _guessing_ it from the environment.

Developers then get exactly what their CLI arguments request, without
having to tweak environment variables.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`,
  `installer.build --fips-backend msgo`, and `process-agent.build` and
  `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS
  binaries, the FIPS target platform applying to both their `build` and
  `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with
  `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with
  `msgo`'s OpenSSL backend, and `cluster-agent.build` and
  `secret-generic-connector.build` with `--fips-backend boringcrypto`,
  as CI runs them, ones with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo`
  backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's
  backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and
  `privateactionrunner.build` pass their flavor's backend, the 2nd and
  3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for
  local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which
  `FipsBackend.strip_boringcrypto()` turns into no backend with a
  warning for `go_build`, whose `GOEXPERIMENT` alone selects it, and
  `schema.compress`,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo`
  of `@msgo` go away, as they were transitional until a target platform
  selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm` with the FIPS
  target platform of its `omnibazel_flags`, whose
  `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`,
  the way rules_go means an SDK to be selected and its `go` tool run:
  https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 16, 2026
…mode (#60204)

🫤  _Sorry for the number of touched files, hence of requested reviewers: this structural change is needed to guard against builds mixing non-FIPS, `msgo`-based FIPS and `boringcrypto`-based FIPS.
The situation will gradually improve as subsequent `bazel()` calls get inlined as 1st-class targets in `BUILD.bazel` files, on the one hand, and as Bazel gets a proper Go SDK with `boringcrypto`, on the other hand._

### What does this PR do?
Let `--enable-bazel` build tasks request FIPS through an explicit `fips_backend`, which selects the FIPS target platform, instead of failing as #59511 made them.

Stop `bazel()` from inferring FIPS from `AGENT_FLAVOR=fips`, which omnibus _still_ sets, every omnibus build task already receiving its FIPS option explicitly, and make it fail hard instead when a call doesn't pass the `msgo` backend, rather than silently building without FIPS.

Pass that backend down every `bazel()` call a FIPS build reaches, as each got the FIPS target platform from `AGENT_FLAVOR` so far.

`go_build` needs it to get `msgo` from `@rules_go//go`[^1], which it then always runs, `cquery` and `info` to locate what `build` produced for that platform, and the other calls to share the configuration of `build` rather than thrashing Bazel's analysis cache.

### Motivation
#59511 blocked FIPS `--enable-bazel` builds because their binaries were silently non-FIPS, and later lacked a RUNPATH to the embedded OpenSSL, which #60334 adds.

[Explicit is better than implicit](https://peps.python.org/pep-0020/): the task that knows it builds FIPS says so, rather than every `bazel()` call _guessing_ it from the environment.

Developers then get exactly what their CLI arguments request, without having to tweak environment variables.

### Describe how you validated your changes
- with `--enable-bazel` and no `AGENT_FLAVOR`, `installer.build --fips-backend msgo`, and `process-agent.build` and `privateactionrunner.build` with `--flavor fips`, build `msgo` FIPS binaries, the FIPS target platform applying to both their `build` and `cquery`, while `--fips-backend boringcrypto` fails,
- without it, `installer.build --fips-backend msgo` with `AGENT_FLAVOR=fips`, as omnibus runs it, still builds a binary with `msgo`'s OpenSSL backend, and `cluster-agent.build` and `secret-generic-connector.build` with `--fips-backend boringcrypto`, as CI runs them, ones with BoringSSL,
- `AGENT_FLAVOR=fips` fails the `bazel()` calls not passing the `msgo` backend, such as `dogstatsd.build`'s,
- every `bazel()` call FIPS omnibus builds reach passes the build's backend.

### Additional Notes
- `agent.build`, `process-agent.build`, `otel-agent.build` and `privateactionrunner.build` pass their flavor's backend, the 2nd and 3rd dropping a `//packages/agent:flavor` their targets don't read,
- `agent.build` also passes it to `rtloader.install-with-bazel`, for local FIPS builds to get FIPS `rtloader` and CPython,
- `bazel()` rejects `boringcrypto`, which `FipsBackend.strip_boringcrypto()` turns into no backend with a warning for `go_build`, whose `GOEXPERIMENT` alone selects it, and `schema.compress`,
- `//:msgo`, its `msgo_binary` wrapper and the root module's `use_repo` of `@msgo` go away, as they were transitional until a target platform selected `msgo`, which #56440 did,
- omnibus' FIPS symbol check runs `@rules_go//go tool nm`[^1] with the FIPS target platform of its `omnibazel_flags`.

[^1]: whose `@rules_go//go/toolchain:sdk_name` resolves `@rules_go//go` to `msgo`, the way `rules_go` means an SDK to be selected and its `go` tool run: https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#using-a-go-sdk

Co-authored-by: regis.desgroppes <[email protected]>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants