Skip to content

Conversation

@kruskall
Copy link
Member

@kruskall kruskall commented Dec 5, 2025

Motivation/summary

The apm-server binary is built as a static Go binary with CGO disabled, so it relies on the pure Go zstd implementation. However, our test suite runs with CGO enabled (required for the race detector), which means it previously exercised a different code path.

To align the test builds with the production binary, we now compile the tests with the pebblegozstd build tag. This forces Pebble to use the Go ZSTD library in both environments.

The same tag also affects the FIPS build, which previously depended on the C-based zstd library due to Microsoft’s Go fork requiring CGO. Switching to the Go implementation brings the FIPS build in line with the standard binary and enhances security by eliminating the C-based zstd dependency.

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

make test

Related issues

Closes #19626

The apm-server binary is built as a static Go binary with CGO disabled,
so it relies on the pure Go zstd implementation. However, our test suite
runs with CGO enabled (required for the race detector), which means
it previously exercised a different code path.

To align the test builds with the production binary, we now compile the
tests with the pebblegozstd build tag. This forces Pebble to use the
Go ZSTD library in both environments.

The same tag also affects the FIPS build, which previously depended on
the C-based zstd library due to Microsoft’s Go fork requiring CGO.
Switching to the Go implementation brings the FIPS build in line with
the standard binary and enhances security by eliminating the C-based zstd
dependency.
@kruskall kruskall requested review from a team as code owners December 5, 2025 17:12
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Dec 5, 2025

This pull request does not have a backport label. Could you fix it @kruskall? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kruskall kruskall added this pull request to the merge queue Dec 9, 2025
Merged via the queue into elastic:main with commit febabd5 Dec 9, 2025
22 checks passed
@kruskall kruskall deleted the tags/pebblegozstd branch December 9, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: use go zstd lib

4 participants