From 1ae88a510af2d90b134f877369285cca2525abcb Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Wed, 30 Oct 2024 14:19:31 +0200 Subject: [PATCH 1/2] Use CGO_ENBABLED=0 for build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 274d09632..89a993a88 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ golangci-lint/%: | $(GOLANGCI_LINT) .PHONY: build build: generate - $(GOCMD) build -o otel-go-instrumentation ./cli/... + CGO_ENABLED=0 $(GOCMD) build -o otel-go-instrumentation ./cli/... .PHONY: docker-build docker-build: From 963e6dbc5064889322317a319a526f3452cc54e2 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Thu, 31 Oct 2024 14:27:01 +0200 Subject: [PATCH 2/2] use conditioanlly set variable for CGO_ENABLED --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 89a993a88..5031f8913 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ BPF_INCLUDE += -I${REPODIR}/internal/include # Go default variables GOCMD?= go +CGO_ENABLED?=0 .DEFAULT_GOAL := precommit @@ -93,7 +94,7 @@ golangci-lint/%: | $(GOLANGCI_LINT) .PHONY: build build: generate - CGO_ENABLED=0 $(GOCMD) build -o otel-go-instrumentation ./cli/... + CGO_ENABLED=$(CGO_ENABLED) $(GOCMD) build -o otel-go-instrumentation ./cli/... .PHONY: docker-build docker-build: