[8.18](backport #5392) fix: package fleet-server using golang-crossbuild #5427
Merged
pkoutsovasilis merged 3 commits into8.18from Sep 8, 2025
Merged
[8.18](backport #5392) fix: package fleet-server using golang-crossbuild #5427pkoutsovasilis merged 3 commits into8.18from
pkoutsovasilis merged 3 commits into8.18from
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) # Conflicts: # .buildkite/pipeline.package.mbp.yml # .buildkite/pipeline.yml # .buildkite/scripts/package.sh # Dockerfile.fips # magefile.go
Contributor
Author
|
Cherry-pick of 7da3f69 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🎉 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) |
8 tasks
Contributor
Author
|
This pull request has not been merged yet. Could you please review and merge it @pkoutsovasilis? 🙏 |
(cherry picked from commit 5aa10ef)
8 tasks
|
pkoutsovasilis
approved these changes
Sep 8, 2025
pkoutsovasilis
approved these changes
Sep 8, 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).