Makefile: always use urfave_cli_no_template build tag

Using text/template disables linker dead code elimination of exported
methods for the whole program (see golang/go#72895). urfave/cli v3.14.0
added urfave_cli_no_template build tag, which makes it render help
without text/template, producing the same output.

Since runc does not use custom help templates, we can always use it.

Together with the previous commits, this makes runc binary about 2 MB
(15%) smaller (13.3 MB -> 11.3 MB on linux/amd64).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin committed 2026-10-03 03:20:56 -07:00
1 parent a945133d52
commit 0774e1d04b
2 files changed
+6 -2

No files matched your search

+4
View File
@@ -43,6 +43,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Switched to opencontainers/cgroups v0.1.0, which no longer uses the
high-level cilium/ebpf API to manage cgroup v2 device rules. As a result,
the runc binary shrunk by about 1 MiB (7.5%) on amd64. (#5403)
- The runc binary is now built with the `urfave_cli_no_template` build tag,
which, together with removing the reflect-based logging of CRIU options,
re-enables the linker's dead code elimination of exported methods. As a
result, the runc binary shrunk by about 2 MB (15%) on amd64. (#5486, #5506)
- The `cpuAffinity` and NUMA `memoryPolicy` settings are no longer limited
to 1024 CPUs/nodes, as runc now uses a dynamically-sized CPU mask. (#5343)
- A container configuration which asks for a read-only rootfs
+2 -2
View File
@@ -45,7 +45,7 @@ ifneq (,$(filter $(GOARCH),386 amd64 arm arm64 loong64 ppc64le riscv64 s390x))
endif
endif
GO_BUILD := $(GO) build $(TRIMPATH) $(GO_BUILDMODE) \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS)" \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS) urfave_cli_no_template" \
-ldflags "$(LDFLAGS_COMMON) $(EXTRA_LDFLAGS)"
GO_BUILDMODE_STATIC :=
@@ -61,7 +61,7 @@ ifneq (,$(filter $(GOARCH),arm64 amd64))
endif
# Enable static PIE binaries on supported platforms.
GO_BUILD_STATIC := $(GO) build $(TRIMPATH) $(GO_BUILDMODE_STATIC) \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo" \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS) urfave_cli_no_template netgo osusergo" \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS_STATIC) $(EXTRA_LDFLAGS)"
GPG_KEYID ?= cyphar@cyphar.com