[8.19](backport #5392) fix: package fleet-server using golang-crossbuild #5428
Merged
pkoutsovasilis merged 1 commit into8.19from Sep 5, 2025
Merged
[8.19](backport #5392) fix: package fleet-server using golang-crossbuild #5428pkoutsovasilis merged 1 commit into8.19from
pkoutsovasilis merged 1 commit into8.19from
Conversation
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69)
8 tasks
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
|
pkoutsovasilis
approved these changes
Sep 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





What is the problem this PR solves?
The
fleet-serverbinary was previously built directly on VM runners instead of using a controlled environment such asgolang-crossbuild.This caused the binary to be dynamically linked against the host system’s GLIBC, introducing higher GLIBC requirements (≥ 2.32) than those declared in the Elastic OS support matrix (≥ 2.17).
Note that, even if the build configuration used
CGO_ENABLED=0(which didn't before this PR) together with-buildmode=pie, on Linux, this combination still produces a dynamically linked binary becausepierelies on the dynamic loader (e.g./lib/ld-linux-aarch64.so.1on arm64).How does this PR solve the problem?
golang-crossbuildimages (viamage docker:release), avoiding linkage against host GLIBC.CGO_ENABLED=0across builds (except for FIPS variants, which require CGO).-buildmode=pieso that binaries are fully static, with no interpreter requirement.x86_64andarm64(including FIPS variants).build/distributions/**) for DRA validation and debugging.mage docker:imagewhen compiling FIPS variants.As a result, Fleet Server binaries are now fully static and do not have a GLIBC requirement, restoring compatibility with Amazon Linux 2 and other supported distributions.
For example, you can download the Linux packaging artifacts from the CI steps introduced in this PR:
Running
fileagainst them after extraction shows static binaries:How to test this PR locally
Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues
This is an automatic backport of pull request #5392 done by [Mergify](https://mergify.com).