Skip to content

chore(ci): build ADP against glibc once again - #2102

Merged
tobz merged 11 commits into
mainfrom
tobz/back-to-glibc
Jul 14, 2026
Merged

chore(ci): build ADP against glibc once again#2102
tobz merged 11 commits into
mainfrom
tobz/back-to-glibc

Conversation

@tobz

@tobz tobz commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

This PR switches ADP to build against glibc instead of MUSL.

A long time ago, we made the decision to link against MUSL, instead of glibc, as our "libc" library. We did this because cleanly and repeatably building against an old enough version of glibc (in keeping with the Datadog Agent's oldest supported operating system versions) was very difficult and fragile. Linking against MUSL, and statically linking in general, let us control our own destiny by not having to worry about using an insanely old build toolchain.

However, as we've started working ADP into the Datadog Agent releases, small issues have come up around our lack of glibc usage.... things like servers that do all of their DNS resolution through glibc NSS/SSSD magic, which totally bypasses normal DNS resolution semantics relied upon by MUSL or other userland DNS library implementations. Similarly, other concerns around the lack of dynamic linking at all have come up over time, namely over what it might mean to try and integrate non-Rust code into ADP.

Rather than continue to step on more landmines around glibc incompatibilities, or a lack of dynamic linking, we've taken another look at once again building ADP against glibc, and the right version of glibc... and things look better these days, so we're switching back.

This PR, in a nutshell, does the following:

  • updates our build-ci container image to be based off of datadog-agent-buildimages/linux, the container image used by the actual DDA CI for building the Agent on Linux
  • removes all of our explicit usages of MUSL
  • updated our build scripts to avoid the MUSL-specific hacks that were in place (kernel header copying, AArch64 "no outline atomics", etc)

There's still some follow-up cleanup we'll need to do, but in general, this is mostly solved by using the container image that Agent uses and just setting the right settings to tell Cargo to invoke things with the crosstool-NG toolchain so that the right glibc version gets used.

Change Type

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

How did you test this PR?

Ensured that the existing CI build jobs (AMD64/ARM64, FIPS vs non-FIPS) still built correctly and that they built against glibc, and the right version of glibc.

References

DADP-2

@dd-octo-sts dd-octo-sts Bot added the area/ci CI/CD, automated testing, etc. label Jul 13, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 13, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/saluki | build-adp-baseline-image   View in Datadog   GitLab

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jul 13, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Optimization Goals: ⚠️ Report unavailable

The benchmark run did not produce a usable report: outputs/report.json is missing

Check the run-benchmarks-adp job logs for details.

@tobz tobz added the type/chore Updates to dependencies or general "administrative" tasks necessary to maintain the codebase/repo. label Jul 13, 2026
@tobz
tobz marked this pull request as ready for review July 13, 2026 20:17
@tobz
tobz requested a review from a team as a code owner July 13, 2026 20:17

@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: 8920ee32bc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .gitlab/benchmark.yml
Comment thread .gitlab-ci.yml
Comment thread ci/images/definitions/build/Dockerfile Outdated
@jszwedko

Copy link
Copy Markdown
Collaborator

Ran a manual verification to check the min glibc version:

amd64

root@f9a719680cf1:/#  objdump -T /usr/local/bin/agent-data-plane | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
2.2.5
2.3
2.3.2
2.3.4
2.4
2.6
2.7
2.9
2.10
2.12
2.14
2.16
2.17

arm64

root@594c77fe9a2e:/# objdump -T /usr/local/bin/agent-data-plane | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
2.17
2.18

@jszwedko jszwedko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about the floor for aarch64, otherwise 👍

@@ -0,0 +1,61 @@
#!/usr/bin/env sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big ➕ to this check. I remember we often accidentally broke glibc compatibility on Vector.

export CC_aarch64_unknown_linux_gnu="${_ctng}-gcc"
export CXX_aarch64_unknown_linux_gnu="${_ctng}-g++"
export AR_aarch64_unknown_linux_gnu="${_ctng}-ar"
TARGET_MAX_GLIBC="2.23"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right glibc max? Looking at the Agent docker image, at least, the Agent seems to only depend on glibc 2.17. Also, ADP seems to only use 2.18:

root@594c77fe9a2e:/# objdump -T /usr/local/bin/agent-data-plane | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
2.17
2.18

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right one I believe, yes.

Based on our supported platforms matrix for ARMv8 (aka ARM64), the minimum glibc version jumps up to 2.23.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the aarch64 deb package too: the Agent seems to only depend on 2.17.

@tobz tobz Jul 14, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as the 2.18 thing... you have to separate out weak symbols. The "floor" is the highest glibc version detected for non-weak symbols, which are the symbols that, when missing, will cause the process to panic.

Weak symbols are basically the spiritual equivalent of Option<T>.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity: we opted to set the floor at 2.17 for both AMD64 and ARM64 since they're actually building that way currently. We'll opt to raise the ARM64 side back up to 2.23 after chatting with folks internally: the supported platforms aspect is correct, but we might actually want to expand it further back if possible.

@tobz
tobz merged commit 3ad18db into main Jul 14, 2026
39 of 46 checks passed
@tobz
tobz deleted the tobz/back-to-glibc branch July 14, 2026 15:46
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 14, 2026
## Summary

The DNS-avoidance workaround added in #2041 (and followed up in #2060) was needed because the previous musl build of ADP failed to bootstrap when \`/etc/resolv.conf\` had no nameservers — Hickory could not load system DNS config even though the Core Agent IPC endpoint is a literal loopback address that requires no resolution. Now that ADP builds against glibc again (#2102), that limitation is gone. This removes the workaround (`endpoint_requires_dns_resolution`, `without_dns_resolution`, and related scaffolding) while keeping the `adp-ipc-no-dns` integration test as a regression guard.

## Test plan

- `adp-ipc-no-dns` integration test confirms ADP bootstraps correctly with an empty `/etc/resolv.conf`
- Unit tests that covered the removed code (`endpoint_requires_dns_resolution`, `connector_builds_without_dns_resolution`) are removed along with the code they covered

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com>
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 14, 2026
## Summary

The DNS-avoidance workaround added in #2041 (and followed up in #2060) was needed because the previous musl build of ADP failed to bootstrap when \`/etc/resolv.conf\` had no nameservers — Hickory could not load system DNS config even though the Core Agent IPC endpoint is a literal loopback address that requires no resolution. Now that ADP builds against glibc again (#2102), that limitation is gone. This removes the workaround (`endpoint_requires_dns_resolution`, `without_dns_resolution`, and related scaffolding) while keeping the `adp-ipc-no-dns` integration test as a regression guard.

## Test plan

- `adp-ipc-no-dns` integration test confirms ADP bootstraps correctly with an empty `/etc/resolv.conf`
- Unit tests that covered the removed code (`endpoint_requires_dns_resolution`, `connector_builds_without_dns_resolution`) are removed along with the code they covered

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com> 8c7f7a8
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 14, 2026
## Summary

This PR removes Hickory DNS in favor of glibc/GAI.

After cutting back to glibc over MUSL in #2102, we want to follow-up by also removing Hickory DNS such that we revert back completely to relying on glibc for DNS resolution. This ensures that any glibc/NSS black magic that is configured on a given system works properly when ADP is used the same as it would when operations are happening in the Datadog Agent directly.

We've kept our own resolver implementation but simply forward to `hyper`'s `GaiResolver` under the hood. This leaves the necessary scaffolding in place to, in the future, change how we spawn the underlying tasks that run the actual resolve operations.

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

## How did you test this PR?

Existing unit and integration tests.

## References

DADP-2

Closes #2115 

Co-authored-by: toby.lawrence <toby.lawrence@datadoghq.com>
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 14, 2026
## Summary

This PR removes Hickory DNS in favor of glibc/GAI.

After cutting back to glibc over MUSL in #2102, we want to follow-up by also removing Hickory DNS such that we revert back completely to relying on glibc for DNS resolution. This ensures that any glibc/NSS black magic that is configured on a given system works properly when ADP is used the same as it would when operations are happening in the Datadog Agent directly.

We've kept our own resolver implementation but simply forward to `hyper`'s `GaiResolver` under the hood. This leaves the necessary scaffolding in place to, in the future, change how we spawn the underlying tasks that run the actual resolve operations.

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

## How did you test this PR?

Existing unit and integration tests.

## References

DADP-2

Closes #2115

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

Labels

area/ci CI/CD, automated testing, etc. type/chore Updates to dependencies or general "administrative" tasks necessary to maintain the codebase/repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants