Skip to content

[ABLD-525] Make FIPS backend selection explicit in build tasks - #59501

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
regis.desgroppes/fips-mode-tri-state
Nov 4, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
regis.desgroppes/fips-mode-tri-state

Conversation

@rdesgroppes

@rdesgroppes rdesgroppes commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Replace the --fips-mode boolean in build tasks by a --fips-backend of none, msgo (Microsoft Go's OpenSSL or CNG backend) or boringcrypto (upstream Go's BoringSSL backend) and propagate it from every build of FIPS packages to go_build.

Make go_build set the matching GOEXPERIMENT, boringcrypto or, for Linux msgo builds, ms_nocgo_opensslcrypto, in place of the CI jobs' variable, cluster_agent.py's derivation from it and tasks/omnibus.py's omnibus-wide one.

Pass --fips-backend=msgo from omnibus, and --fips-backend=boringcrypto from the cluster-agent and secret-generic-connector FIPS jobs.

Make the --enable-bazel FIPS refusals from #59511 key on --fips-backend.

Motivation

The boolean conflated 2 FIPS backends needing different Go distributions, since msgo rejects GOEXPERIMENT=boringcrypto.
Each therefore relied on the environment instead: BoringCrypto builds on a job variable that cluster_agent.py read back, Linux msgo builds on an omnibus-wide GOEXPERIMENT, and both on whichever go came first on PATH.

Naming the backend lets the build pick the Go distribution, which is what bazelifying it requires: #58530 maps msgo to the Bazel-fetched //:msgo, and a Bazel build can likewise select its toolchain from that value rather than from inherited variables.

Describe how you validated your changes

With GOEXPERIMENT unset, checked that:

  • cluster-agent.build and secret-generic-connector.build with --fips-backend=boringcrypto link BoringCrypto (_Cfunc__goboringcrypto_ symbols), the former into its secret-generic-connector too, and not without it,
  • with msgo on PATH, as add_msgo_to_env puts it, dda inv -- -e installer.build --fips-backend=msgo --no-cgo and dda inv -- -e agent.build --build-exclude=systemd --flavor fips record GOEXPERIMENT=ms_nocgo_opensslcrypto and link its OpenSSL backend, the former setting its RUNPATH,
  • an invalid --fips-backend value, and any FIPS backend with --enable-bazel, fail fast,
  • dda inv -- -e linter.python, dda inv -- -e linter.gitlab-ci, dda inv -- -e linter.gitlab-ci-shellcheck and dda inv -- -e invoke-unit-tests.run for go, omnibus and cluster_agent_helpers pass.

Additional Notes

It also leaves room for upstream Go's native FIPS 140-3 module, which is selected through GOFIPS140 and meant to later replace BoringCrypto (https://go.dev/doc/security/fips140): one more value handled by go_build, rather than another variable to thread through CI jobs and omnibus.

@rdesgroppes rdesgroppes added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Nov 3, 2026
@rdesgroppes rdesgroppes changed the title [ABLD-525] Replace the FIPS boolean of build tasks by a --fips-backend [ABLD-525] Replace the FIPS boolean in build tasks by a --fips-backend Nov 3, 2026
@github-actions github-actions Bot added the long review PR is complex, plan time to review it label Nov 3, 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 incorrect: the new backend option is silently ignored when building the Cluster Agent through Bazel, allowing a requested FIPS build to produce a non-FIPS binary. Python tests could not run because invoke is unavailable.

(obsolete: #59501 (comment))

Comment thread tasks/cluster_agent.py Resolved
@dd-octo-sts

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

Copy link
Copy Markdown
Contributor

Gitlab CI Configuration Changes

Modified Jobs

.cluster_agent-build_common
  .cluster_agent-build_common:
    artifacts:
      exclude:
      - Dockerfiles/cluster-agent/security-agent-policies/.git/**/*
      - Dockerfiles/cluster-agent/security-agent-policies/.github/**/*
      paths:
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector
      - Dockerfiles/cluster-agent/datadog-cluster.yaml
      - Dockerfiles/cluster-agent/security-agent-policies
    before_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
    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
    needs:
    - setup_agent_version
    - go_deps
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/ || ($GIT_BASE_BRANCH != null &&
        $GIT_BASE_BRANCH != "main" && $GIT_BASE_BRANCH !~ /^[67]\.[0-9]+\.x$/)
      when: never
    - when: on_success
    script:
    - dda inv -- check-go-version
-   - dda inv -- -e cluster-agent.build
+   - dda inv -- -e cluster-agent.build $FIPS_BACKEND_FLAG
?                                      +++++++++++++++++++
    - cp $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
    - strip $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
    stage: binary_build
    timeout: 30m
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
+     FIPS_BACKEND_FLAG: ''
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
cluster_agent-build_amd64
  cluster_agent-build_amd64:
    artifacts:
      exclude:
      - Dockerfiles/cluster-agent/security-agent-policies/.git/**/*
      - Dockerfiles/cluster-agent/security-agent-policies/.github/**/*
      paths:
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector
      - Dockerfiles/cluster-agent/datadog-cluster.yaml
      - Dockerfiles/cluster-agent/security-agent-policies
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e cluster-agent.build
+   - dda inv -- -e cluster-agent.build $FIPS_BACKEND_FLAG
?                                      +++++++++++++++++++
    - cp $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
    - strip $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
    stage: binary_build
    tags:
    - arch:amd64
    - specific:true
    timeout: 30m
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
+     FIPS_BACKEND_FLAG: ''
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
cluster_agent-build_arm64
  cluster_agent-build_arm64:
    artifacts:
      exclude:
      - Dockerfiles/cluster-agent/security-agent-policies/.git/**/*
      - Dockerfiles/cluster-agent/security-agent-policies/.github/**/*
      paths:
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector
      - Dockerfiles/cluster-agent/datadog-cluster.yaml
      - Dockerfiles/cluster-agent/security-agent-policies
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e cluster-agent.build
+   - dda inv -- -e cluster-agent.build $FIPS_BACKEND_FLAG
?                                      +++++++++++++++++++
    - cp $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
    - strip $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
    stage: binary_build
    tags:
    - arch:arm64
    - specific:true
    timeout: 30m
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
+     FIPS_BACKEND_FLAG: ''
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
cluster_agent_fips-build_amd64
  cluster_agent_fips-build_amd64:
    artifacts:
      exclude:
      - Dockerfiles/cluster-agent/security-agent-policies/.git/**/*
      - Dockerfiles/cluster-agent/security-agent-policies/.github/**/*
      paths:
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector
      - Dockerfiles/cluster-agent/datadog-cluster.yaml
      - Dockerfiles/cluster-agent/security-agent-policies
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e cluster-agent.build
+   - dda inv -- -e cluster-agent.build $FIPS_BACKEND_FLAG
?                                      +++++++++++++++++++
    - cp $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
    - strip $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
    stage: binary_build
    tags:
    - arch:amd64
    - specific:true
    timeout: 30m
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     GOEXPERIMENT: boringcrypto
+     FIPS_BACKEND_FLAG: --fips-backend=boringcrypto
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
cluster_agent_fips-build_arm64
  cluster_agent_fips-build_arm64:
    artifacts:
      exclude:
      - Dockerfiles/cluster-agent/security-agent-policies/.git/**/*
      - Dockerfiles/cluster-agent/security-agent-policies/.github/**/*
      paths:
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
      - $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector
      - Dockerfiles/cluster-agent/datadog-cluster.yaml
      - Dockerfiles/cluster-agent/security-agent-policies
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e cluster-agent.build
+   - dda inv -- -e cluster-agent.build $FIPS_BACKEND_FLAG
?                                      +++++++++++++++++++
    - cp $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent-unstripped
    - strip $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
    stage: binary_build
    tags:
    - arch:arm64
    - specific:true
    timeout: 30m
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     GOEXPERIMENT: boringcrypto
+     FIPS_BACKEND_FLAG: --fips-backend=boringcrypto
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
secret_generic_connector_fips-build_amd64
  secret_generic_connector_fips-build_amd64:
    artifacts:
      paths:
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.$ARCH
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e secret-generic-connector.build --arch-suffix --fips-mode
?                                                                       ^ ^^
+   - dda inv -- -e secret-generic-connector.build --arch-suffix --fips-backend=boringcrypto
?                                                                       ^^^^^^^^^ ^^^^^^^^^^
    - go tool nm $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.${ARCH}
      | grep '_Cfunc__goboringcrypto_'
    - go tool nm $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.${ARCH}
      | grep 'crypto/tls/fipsonly'
    stage: binary_build
    tags:
    - arch:amd64
    - specific:true
    variables:
      ARCH: amd64
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      DD_CC: x86_64-linux-gnu-gcc
      DD_CXX: x86_64-linux-gnu-g++
-     GOEXPERIMENT: boringcrypto
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 8
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
secret_generic_connector_fips-build_arm64
  secret_generic_connector_fips-build_arm64:
    artifacts:
      paths:
      - $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.$ARCH
    before_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
    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:
    - dda inv -- check-go-version
-   - dda inv -- -e secret-generic-connector.build --arch-suffix --fips-mode
?                                                                       ^ ^^
+   - dda inv -- -e secret-generic-connector.build --arch-suffix --fips-backend=boringcrypto
?                                                                       ^^^^^^^^^ ^^^^^^^^^^
    - go tool nm $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.${ARCH}
      | grep '_Cfunc__goboringcrypto_'
    - go tool nm $SECRET_GENERIC_CONNECTOR_BINARIES_DIR/secret-generic-connector.${ARCH}
      | grep 'crypto/tls/fipsonly'
    stage: binary_build
    tags:
    - arch:arm64
    - specific:true
    variables:
      ARCH: arm64
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      DD_CC: aarch64-linux-gnu-gcc
      DD_CXX: aarch64-linux-gnu-g++
-     GOEXPERIMENT: boringcrypto
      KUBERNETES_CPU_LIMIT: 16
      KUBERNETES_CPU_REQUEST: 8
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache

Changes Summary

Removed Modified Added Renamed
0 7 0 0

ℹ️ Diff available in the job log.

@datadog-datadog-prod-us1-2

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

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 66.67% (+4.10%)

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

@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/fips-mode-tri-state branch 2 times, most recently from 393e68b to 3664a45 Compare November 3, 2026 09:12

@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: 393e68b4ac

ℹ️ 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 tasks/cws_instrumentation.py Resolved
@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/fips-mode-tri-state branch from 3664a45 to dd5a1a1 Compare November 3, 2026 09:22

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

ℹ️ 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 tasks/flavor.py Resolved
Comment thread tasks/loader.py Resolved
Comment thread tasks/systray.py Resolved
@dd-octo-sts

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

Copy link
Copy Markdown
Contributor

Static quality checks

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

33 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
✅ agent_deb_amd64 759.652 MiB
✅ agent_deb_amd64_fips 690.344 MiB
✅ agent_heroku_amd64 313.658 MiB
✅ agent_msi 667.907 MiB
✅ agent_rpm_amd64 759.634 MiB
✅ agent_rpm_amd64_fips 690.326 MiB
✅ agent_rpm_arm64 729.320 MiB
✅ agent_rpm_arm64_fips 665.778 MiB
✅ agent_suse_amd64 759.634 MiB
✅ agent_suse_amd64_fips 690.326 MiB
✅ agent_suse_arm64 729.320 MiB
✅ agent_suse_arm64_fips 665.778 MiB
✅ docker_agent_amd64 815.668 MiB
✅ docker_agent_arm64 810.000 MiB
✅ docker_agent_jmx_amd64 1006.532 MiB
✅ docker_agent_jmx_arm64 989.648 MiB
✅ docker_cws_instrumentation_amd64 7.513 MiB
✅ docker_cws_instrumentation_arm64 7.002 MiB
✅ docker_dogstatsd_amd64 40.220 MiB
✅ docker_dogstatsd_arm64 38.255 MiB
✅ docker_host_profiler_amd64 314.678 MiB
✅ docker_host_profiler_arm64 325.468 MiB
✅ dogstatsd_deb_amd64 30.972 MiB
✅ dogstatsd_deb_arm64 28.894 MiB
✅ dogstatsd_rpm_amd64 30.972 MiB
✅ dogstatsd_suse_amd64 30.972 MiB
✅ iot_agent_deb_amd64 48.284 MiB
✅ iot_agent_deb_arm64 44.669 MiB
✅ iot_agent_deb_armhf 45.482 MiB
✅ iot_agent_rpm_amd64 48.285 MiB
✅ iot_agent_suse_amd64 48.283 MiB
✅ docker_cluster_agent_amd64 217.748 MiB
✅ docker_cluster_agent_arm64 230.463 MiB

@rdesgroppes
rdesgroppes force-pushed the regis.desgroppes/fips-mode-tri-state branch from dd5a1a1 to e83aeaa Compare November 3, 2026 14:57
@rdesgroppes rdesgroppes changed the title [ABLD-525] Replace the FIPS boolean in build tasks by a --fips-backend [ABLD-525] Make FIPS backend selection explicit in build tasks Nov 3, 2026
@rdesgroppes
rdesgroppes marked this pull request as ready for review November 3, 2026 15:27
@rdesgroppes
rdesgroppes requested a review from a team as a code owner November 3, 2026 15:27
Comment thread tasks/libs/common/go.py Resolved
@rdesgroppes
rdesgroppes requested a review from pgimalac November 4, 2026 15:10
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit b932849 into main Nov 4, 2026
734 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the regis.desgroppes/fips-mode-tri-state branch November 4, 2026 16:58
@github-actions github-actions Bot added this to the 7.87.0 milestone Nov 4, 2026
rdesgroppes added a commit that referenced this pull request Nov 4, 2026
### What does this PR do?

Make `go_build` run `bazel run //:msgo --` for the `msgo` FIPS backend
instead of the `msgo` preinstalled in build images, and the omnibus FIPS
symbol check run `tool nm` the same way.
Drop `installer.rb`'s `add_msgo_to_env` call, the installer build
running no other `go`.

### Motivation

Evaluate replacing the preinstalled `msgo` with the Bazel-fetched one
from #58511, now that #59501 has every FIPS build name its backend.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 4, 2026
### What does this PR do?

Make `go_build` run `bazel run //:msgo --` for the `msgo` FIPS backend
instead of the `msgo` preinstalled in build images, and the omnibus FIPS
symbol check run `tool nm` the same way.
Drop `installer.rb`'s `add_msgo_to_env` call, the installer build
running no other `go`.

### Motivation

Evaluate replacing the preinstalled `msgo` with the Bazel-fetched one
from #58511, now that #59501 has every FIPS build name its backend.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 4, 2026
### What does this PR do?

Make `go_build` run `bazel run //:msgo --` for the `msgo` FIPS backend
instead of the `msgo` preinstalled in build images, and the omnibus FIPS
symbol check run `tool nm` the same way.
Drop `installer.rb`'s `add_msgo_to_env` call, the installer build
running no other `go`.

### Motivation

Evaluate replacing the preinstalled `msgo` with the Bazel-fetched one
from #58511, now that #59501 has every FIPS build name its backend.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Make `go_build` run `bazel run //:msgo --` for the `msgo` FIPS backend
instead of the `msgo` preinstalled in build images, and the omnibus
symbol inspector run `tool nm` through `//:msgo` in FIPS mode and
`//:go` otherwise.
Drop `installer.rb`'s `add_msgo_to_env` call, the installer build
running no other `go`.

### Motivation

Evaluate replacing the preinstalled `msgo` with the Bazel-fetched one
from #58511, now that #59501 has every FIPS build name its backend.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Make `go_build` build the `msgo` FIPS backend with
`bazel run //:msgo --` instead of the `msgo` preinstalled in build
images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in
FIPS mode and `//:go` otherwise, instead of the `go` on `PATH`.
Drop `installer.rb`'s `add_msgo_to_env` call, the installer build
running no other `go`.
The agent and OTel agent builds keep it for their other `go` commands,
and builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation

FIPS builds take `msgo` from the build images, where `add_msgo_to_env`
puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with
the image rather than being pinned like the other Bazel toolchains, and
is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build
name its backend, so `go_build` can now route exactly the `msgo` builds
to that toolchain, one step towards building Go binaries with Bazel
only.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `bazel run //:go -- tool nm` lists the symbols of a binary on Linux
  and Windows, as `bazel run //:msgo -- tool nm` does,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Make `go_build` build the `msgo` FIPS backend with
`bazel run //:msgo --` instead of the `msgo` preinstalled in build
images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in
FIPS mode and `//:go` otherwise, instead of the `go` on `PATH`.
Remove `add_msgo_to_env` and the Windows `MSGO_ROOT` lookup feeding it,
no omnibus FIPS build running any other `go` needing the preinstalled
`msgo`.
Builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation

FIPS builds take `msgo` from the build images, where `add_msgo_to_env`
puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with
the image rather than being pinned like the other Bazel toolchains, and
is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build
name its backend, so `go_build` can now route exactly the `msgo` builds
to that toolchain, one step towards building Go binaries with Bazel
only.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `bazel run //:go -- tool nm` lists the symbols of a binary on Linux
  and Windows, as `bazel run //:msgo -- tool nm` does,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Make `go_build` build the `msgo` FIPS backend with
`bazel run //:msgo --` instead of the `msgo` preinstalled in build
images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in
FIPS mode and `//:go` otherwise, instead of the `go` on `PATH`.
Remove `add_msgo_to_env` and the Windows `MSGO_ROOT` lookup feeding it,
no omnibus FIPS build running any other `go` needing the preinstalled
`msgo`.
Remove `get_omnibus_env`'s `fips_mode` argument with them, its only
other effect being a `FIPS_MODE` variable nothing reads.
Builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation

FIPS builds take `msgo` from the build images, where `add_msgo_to_env`
puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with
the image rather than being pinned like the other Bazel toolchains, and
is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build
name its backend, so `go_build` can now route exactly the `msgo` builds
to that toolchain, one step towards building Go binaries with Bazel.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `bazel run //:go -- tool nm` lists the symbols of a binary on Linux
  and Windows, as `bazel run //:msgo -- tool nm` does,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Make `go_build` build the `msgo` FIPS backend with
`bazel run //:msgo --` instead of the `msgo` preinstalled in build
images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in
FIPS mode and `//:go` otherwise, instead of the `go` on `PATH`.
Remove `add_msgo_to_env` and the Windows `MSGO_ROOT` lookup feeding it,
no omnibus FIPS build running any other `go` needing the preinstalled
`msgo`.
Remove `get_omnibus_env`'s `fips_mode` argument with them, its only
other effect being a `FIPS_MODE` variable nothing reads.
Builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation

FIPS builds take `msgo` from the build images, where `add_msgo_to_env`
puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with
the image rather than being pinned like the other Bazel toolchains, and
is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build
name its backend, so `go_build` can now route exactly the `msgo` builds
to that toolchain, one step towards building Go binaries with Bazel.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `bazel run //:go tool nm` lists the symbols of a binary on Linux and
  Windows, as `bazel run //:msgo tool nm` does,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
rdesgroppes added a commit that referenced this pull request Nov 6, 2026
### What does this PR do?

Make `go_build` build the `msgo` FIPS backend with
`bazel run //:msgo --` instead of the `msgo` preinstalled in build
images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in
FIPS mode and `@rules_go//go` otherwise, instead of the `go` on `PATH`.
Remove `add_msgo_to_env` and the Windows `MSGO_ROOT` lookup feeding it,
no omnibus FIPS build running any other `go` needing the preinstalled
`msgo`.
Remove `get_omnibus_env`'s `fips_mode` argument with them, its only
other effect being a `FIPS_MODE` variable nothing reads.
Builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation

FIPS builds take `msgo` from the build images, where `add_msgo_to_env`
puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with
the image rather than being pinned like the other Bazel toolchains, and
is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build
name its backend, so `go_build` can now route exactly the `msgo` builds
to that toolchain, one step towards building Go binaries with Bazel.

### Describe how you validated your changes

With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with
  `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never
  runs that `go`, and builds the Linux installer with `msgo`, recording
  `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend
  (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even
  when `bazelisk` is a shim changing to another checkout, as omnibus's
  is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips`
  builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a
  `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows
  installer with `msgo`,
- `bazel run @rules_go//go tool nm` lists the symbols of a binary on
  Linux and Windows, as `bazel run //:msgo tool nm` does,
- `dda inv -- -e linter.python` and
  `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes

`go_build` passes `-C` with the current directory to the Bazel `go`,
because omnibus's `bazel` shim runs Bazel from the original checkout
while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it
cannot resolve `install_dir` itself, and Bazel would otherwise discard
its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH`
`go` command lines quote them the shell's way rather than with
hand-written double quotes.
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 6, 2026
…8530)

<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->

### What does this PR do?
Make `go_build` build the `msgo` FIPS backend with `bazel run //:msgo --` instead of the `msgo` preinstalled in build images.
Make the omnibus symbol inspector run `tool nm` through `//:msgo` in FIPS mode and `@rules_go//go` otherwise, instead of the `go` on `PATH`.
Remove `add_msgo_to_env` and the Windows `MSGO_ROOT` lookup feeding it, no omnibus FIPS build running any other `go` needing the preinstalled `msgo`.
Remove `get_omnibus_env`'s `fips_mode` argument with them, its only other effect being a `FIPS_MODE` variable nothing reads.
Builds without the `msgo` backend keep the `go` on `PATH`.

### Motivation
FIPS builds take `msgo` from the build images, where `add_msgo_to_env` puts it ahead of the `go` on `PATH`, so the FIPS toolchain comes with the image rather than being pinned like the other Bazel toolchains, and is selected by altering the environment every `go` command shares.
#58511 made `msgo` a Bazel toolchain and #59501 made every FIPS build name its backend, so `go_build` can now route exactly the `msgo` builds to that toolchain, one step towards building Go binaries with Bazel.

### Describe how you validated your changes
With upstream Go as the `go` on `PATH`, checked that:
- `dda inv -- -e installer.build --fips-backend=msgo --no-cgo` with `installer.rb`'s run and install paths and `DEPLOY_AGENT=true` never runs that `go`, and builds the Linux installer with `msgo`, recording `GOEXPERIMENT=ms_nocgo_opensslcrypto`, linking its OpenSSL backend (`go-crypto-openssl/openssl` symbols) and setting its RUNPATH, even when `bazelisk` is a shim changing to another checkout, as omnibus's is,
- `dda inv -- -e agent.build --build-exclude=systemd --flavor fips` builds with `msgo`, linking its OpenSSL backend,
- builds outside the `msgo` backend still use that `go`, a `boringcrypto` secret-generic-connector included,
- `dda inv -- -e installer.build --fips-backend=msgo` builds the Windows installer with `msgo`,
- `bazel run @rules_go//go tool nm` lists the symbols of a binary on Linux and Windows, as `bazel run //:msgo tool nm` does,
- `dda inv -- -e linter.python` and `dda inv -- -e invoke-unit-tests.run --tests=go` pass.

### Additional Notes
`go_build` passes `-C` with the current directory to the Bazel `go`, because omnibus's `bazel` shim runs Bazel from the original checkout while the build runs in omnibus's source copy.
The symbol inspector gets `omnibazel_flags` from its callers, because it cannot resolve `install_dir` itself, and Bazel would otherwise discard its analysis cache.
`go_build` now joins its arguments with `join_command`, so its `PATH` `go` command lines quote them the shell's way rather than with hand-written double quotes.






Co-authored-by: regis.desgroppes <[email protected]>
rdesgroppes added a commit to DataDog/datadog-agent-buildimages that referenced this pull request Nov 9, 2026
### What does this PR do?
Stop installing the Microsoft build of Go in the Linux and Windows
images, and drop its release and checksums from `go.env`,
`docker-bake.override.json` and `dda run update go`, whose
`--msgo-patch` option goes with them.

Drop the Go update workflow's check that `microsoft/go` published the
requested release.

Drop `MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0` from the Linux and Windows
images, DataDog/datadog-agent#59840 disabling `msgo` telemetry in its
Bazel SDK instead.

### Motivation
Omnibus FIPS builds took `msgo` from `/usr/local/msgo` on Linux and
`C:\msgo` on Windows, through `datadog-agent`'s `add_msgo_to_env`.

DataDog/datadog-agent#58511 made `msgo` a Bazel toolchain pinned from
`microsoft/go`'s release manifest, DataDog/datadog-agent#59501 made
every FIPS build name its backend, and DataDog/datadog-agent#58530
builds the `msgo` backend with `bazel run //:msgo` and removes
`add_msgo_to_env`, leaving the preinstalled `msgo` without any reader.

### Possible Drawbacks / Trade-offs
A Go update is no longer held back until `microsoft/go` publishes it
(may take a few days), `datadog-agent`'s Bazel Go builds failing instead
while `msgo` lacks the release.

This should not be a problem because we've not been adopting Go releases
right away.

### Additional Notes
The `go_builder` stage's `DD_GO_TOOLCHAIN` switch goes too, its
`.bashrc` never reaching the final image.
rdesgroppes added a commit to DataDog/datadog-agent-buildimages that referenced this pull request Nov 9, 2026
### What does this PR do?
Stop installing the Microsoft build of Go in the Linux and Windows
images, and drop its release and checksums from `go.env`,
`docker-bake.override.json` and `dda run update go`, whose
`--msgo-patch` option goes with them.

Drop the Go update workflow's check that `microsoft/go` published the
requested release.

Drop `MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0` from the Linux and Windows
images, DataDog/datadog-agent#59840 disabling `msgo` telemetry in its
Bazel SDK instead.

### Motivation
Omnibus FIPS builds took `msgo` from `/usr/local/msgo` on Linux and
`C:\msgo` on Windows, through `datadog-agent`'s `add_msgo_to_env`.

DataDog/datadog-agent#58511 made `msgo` a Bazel toolchain pinned from
`microsoft/go`'s release manifest, DataDog/datadog-agent#59501 made
every FIPS build name its backend, and DataDog/datadog-agent#58530
builds the `msgo` backend with `bazel run //:msgo` and removes
`add_msgo_to_env`, leaving the preinstalled `msgo` without any reader.

### Possible Drawbacks / Trade-offs
A Go update is no longer held back until `microsoft/go` publishes it
(may take a few days), `datadog-agent`'s Bazel Go builds failing instead
while `msgo` lacks the release.

This should not be a problem because we've not been adopting Go releases
right away: worst case, the Renovate-generated buildimage bump stays on
hold until Microsoft ships its counterpart.

### Additional Notes
The `go_builder` stage's `DD_GO_TOOLCHAIN` switch goes too, its
`.bashrc` never reaching the final image, whereas #1386 removed
`setup/go.sh` along with other unreferenced scripts.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.