From f3d2ea56acda3231f4af1029df4474476844e29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paolo=20Chil=C3=A0?= Date: Fri, 17 Oct 2025 11:21:24 +0200 Subject: [PATCH] re-enable CGO and buildmode pie (#5715) (cherry picked from commit 693bd7bafec08ca7ca0c4c63e91d828ca2465c8a) --- magefile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magefile.go b/magefile.go index 607e07138..1bbdaef25 100644 --- a/magefile.go +++ b/magefile.go @@ -90,6 +90,7 @@ const ( // const and vars used by magefile. const ( + buildMode = "pie" binaryName = "fleet-server" binaryExe = "fleet-server.exe" @@ -695,7 +696,6 @@ func (Check) All() { // FIPS creates a FIPS capable binary. func (Build) Local() error { env := environMap() - env["CGO_ENABLED"] = "0" if isFIPS() { addFIPSEnvVars(env) } @@ -729,7 +729,6 @@ func goBuild(osArg, archArg string, cover bool) error { env := environMap() env["GOOS"] = osArg env["GOARCH"] = archArg - env["CGO_ENABLED"] = "0" distArr := []string{"fleet-server"} if isFIPS() { addFIPSEnvVars(env) @@ -755,6 +754,7 @@ func goBuild(osArg, archArg string, cover bool) error { "-tags=" + getTagsString(), "-gcflags=" + getGCFlags(), "-ldflags=" + getLDFlags(), + "-buildmode=" + buildMode, "-o", outFile, } if cover {