Skip to content

Commit b03b667

Browse files
fix: disable CGO and buildmode pie
1 parent 1e00c3b commit b03b667

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

magefile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const (
9090

9191
// const and vars used by magefile.
9292
const (
93-
buildMode = "pie"
9493
binaryName = "fleet-server"
9594
binaryExe = "fleet-server.exe"
9695

@@ -671,6 +670,7 @@ func (Check) All() {
671670
// FIPS creates a FIPS capable binary.
672671
func (Build) Local() error {
673672
env := environMap()
673+
env["CGO_ENABLED"] = "0"
674674
if isFIPS() {
675675
addFIPSEnvVars(env)
676676
}
@@ -704,6 +704,7 @@ func goBuild(osArg, archArg string, cover bool) error {
704704
env := environMap()
705705
env["GOOS"] = osArg
706706
env["GOARCH"] = archArg
707+
env["CGO_ENABLED"] = "0"
707708
distArr := []string{"fleet-server"}
708709
if isFIPS() {
709710
addFIPSEnvVars(env)
@@ -729,7 +730,6 @@ func goBuild(osArg, archArg string, cover bool) error {
729730
"-tags=" + getTagsString(),
730731
"-gcflags=" + getGCFlags(),
731732
"-ldflags=" + getLDFlags(),
732-
"-buildmode=" + buildMode,
733733
"-o", outFile,
734734
}
735735
if cover {

0 commit comments

Comments
 (0)