From f60d447c16991a183853cce58d21d88351cb0f16 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 8 Jun 2021 16:53:05 +0200 Subject: [PATCH 1/2] Makefile: fix tags parameter computation In the current implementation, the build tags arguments can catch up an extra trailing whitespace. Since this parameter is passed in quotes, the shell won't strip it, leading to the wrong tags passed. Therefore just strip it explicitly. Signed-off-by: Enrico Weigelt, metux IT consult --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f53c10ab7..621c5ad3a 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ ifdef BUILDTAGS endif GO_BUILDTAGS ?= GO_BUILDTAGS += ${DEBUG_TAGS} -GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)",) +GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(strip $(GO_BUILDTAGS))",) GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)' SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static" $(EXTRA_LDFLAGS)' From 2bb8ad7c9ea4f626527a33dce51b89d3278194a2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 8 Jun 2021 16:53:05 +0200 Subject: [PATCH 2/2] Makefile: pass build tags to manpage build process The 'go run' command in manpage build stage currently doesn't know about build tags yet. This could lead to strange effects when eg. optional deps are switched off. Therefore also pass the tags to the 'go run' calls. Signed-off-by: Enrico Weigelt, metux IT consult --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 621c5ad3a..f0d647e15 100644 --- a/Makefile +++ b/Makefile @@ -244,11 +244,11 @@ genman: man/containerd.8 man/ctr.8 man/containerd.8: FORCE @echo "$(WHALE) $@" - $(GO) run cmd/gen-manpages/main.go $(@F) $(@D) + $(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D) man/ctr.8: FORCE @echo "$(WHALE) $@" - $(GO) run cmd/gen-manpages/main.go $(@F) $(@D) + $(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D) man/%: docs/man/%.md FORCE @echo "$(WHALE) $@"