From 61ccbb3f5a2564376af13ea9bbfe51e364fcb3a1 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Mon, 17 May 2021 09:39:27 +0000 Subject: [PATCH] chore: keep debug symbols in debug builds Makes debugging easier. Signed-off-by: Alexey Palazhchenko --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2f979af883..f95984ecc6 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ MGMT_HELPERS_PKG = github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers CGO_ENABLED ?= 0 GO_BUILDFLAGS ?= -GO_LDFLAGS ?= -s -w \ +GO_LDFLAGS ?= \ -X $(VERSION_PKG).Name=$(NAME) \ -X $(VERSION_PKG).SHA=$(SHA) \ -X $(VERSION_PKG).Tag=$(TAG) \ @@ -58,6 +58,8 @@ endif ifeq ($(shell hack/parsebool.sh $(WITH_DEBUG); echo $$?), 1) GO_BUILDFLAGS += -tags sidero.debug +else +GO_LDFLAGS += -s -w endif , := ,