aports/testing/ko/unset-CGO_ENABLED.patch
omni 3e232d8251 testing/ko: patch out CGO_ENABLED
since the go 1.22 upgrade aports started to fail to build on arm*,
riscv64, s390x & x86, with -buildmode=pie and CGO_ENABLED=0 set
2024-04-05 20:25:22 +00:00

20 lines
602 B
Diff

--- a/pkg/build/gobuild_test.go
+++ b/pkg/build/gobuild_test.go
@@ -229,7 +229,6 @@ func TestBuildEnv(t *testing.T) {
expectedEnvs: map[string]string{
"GOOS": "linux",
"GOARCH": "amd64",
- "CGO_ENABLED": "0",
},
}, {
description: "override a default value",
--- a/pkg/build/gobuild.go
+++ b/pkg/build/gobuild.go
@@ -442,7 +442,6 @@ func cycloneDX() sbomber {
func buildEnv(platform v1.Platform, userEnv, configEnv []string) ([]string, error) {
// Default env
env := []string{
- "CGO_ENABLED=0",
"GOOS=" + platform.OS,
"GOARCH=" + platform.Architecture,
}