From 0c9fabe1fb382c4a7a5ffe63ff67814479b36838 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 26 Oct 2026 17:34:10 +0100 Subject: [PATCH 1/2] Makefile: disable legacy gRPC tracing Add the `grpcnotrace` build tag to exclude gRPC's legacy tracing integration and reduce binary sizes. This reduces the size of containerd by ~272 KiB, containerd-stress by ~448 KiB, and ctr by ~512 KiB, saving ~1.2 MiB overall. Signed-off-by: Sebastiaan van Stijn --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 367dc73792..d68dc58bd7 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ifdef BUILDTAGS GO_BUILDTAGS = ${BUILDTAGS} endif GO_BUILDTAGS ?= -GO_BUILDTAGS += urfave_cli_no_docs +GO_BUILDTAGS += grpcnotrace urfave_cli_no_docs GO_BUILDTAGS += ${DEBUG_TAGS} ifneq ($(STATIC),) GO_BUILDTAGS += osusergo netgo static_build From a320f1cbb086259088acfd93b00eb154b142fb61 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 26 Oct 2026 17:37:03 +0100 Subject: [PATCH 2/2] Makefile: remove obsolete urfave_cli_no_docs build tag The `urfave_cli_no_docs` build tag was removed in urfave/cli v3, with doc generation moved to a separate module. Remove the obsolete tag and the special handling for gen-manpages, which is no longer needed after the migration to v3. updates f72829f36b8ed0562644bf45b6c3397f52ad614b. Signed-off-by: Sebastiaan van Stijn --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d68dc58bd7..a39c97e0f8 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ifdef BUILDTAGS GO_BUILDTAGS = ${BUILDTAGS} endif GO_BUILDTAGS ?= -GO_BUILDTAGS += grpcnotrace urfave_cli_no_docs +GO_BUILDTAGS += grpcnotrace GO_BUILDTAGS += ${DEBUG_TAGS} ifneq ($(STATIC),) GO_BUILDTAGS += osusergo netgo static_build @@ -264,10 +264,9 @@ endef bin/%: cmd/% FORCE $(call BUILD_BINARY) -# gen-manpages must not have the urfave_cli_no_docs build-tag set bin/gen-manpages: cmd/gen-manpages FORCE @echo "$(WHALE) $@" - $(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} $(subst urfave_cli_no_docs,,${GO_TAGS}) ./cmd/gen-manpages + $(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./cmd/gen-manpages bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 @echo "$(WHALE) $@"