From 1d9c0d6c27561743a32732b591ac680941746f8e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 7 Aug 2024 00:20:00 +0200 Subject: [PATCH] deb, rpm: fix runc using incorrect version runc v1.1.13 introduced an option to customize the version (as printed by the `--version` flag) through a `VERSION` Make variable / environment variable (see [1]). This variable collided with the `VERSION` environment variable used by containerd for the same purpose, which lead to `runc` binaries built using the version of containerd; runc --version runc version 1.7.20 commit: v1.1.13-0-g58aa9203 ... This patch explicitly sets the `VERSION` variable to the version of runc being built when building the binary. [1]: https://github.com/opencontainers/runc/commit/6f4d975c402d7848f5097f53c18000aa42581def Signed-off-by: Sebastiaan van Stijn --- debian/rules | 3 ++- rpm/containerd.spec | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 42601f0d..c7a14cd0 100755 --- a/debian/rules +++ b/debian/rules @@ -44,7 +44,8 @@ binaries: ## Create containerd binaries rm -f bin/containerd-stress bin/runc: - @set -x; make -C /go/src/github.com/opencontainers/runc --no-print-directory \ + # Unset the VERSION variable as it's meant for containerd's version, not runc. + @set -x; env -u VERSION make -C /go/src/github.com/opencontainers/runc --no-print-directory \ BINDIR="$$(pwd)/bin" \ runc install diff --git a/rpm/containerd.spec b/rpm/containerd.spec index 6c565b79..f827aab3 100644 --- a/rpm/containerd.spec +++ b/rpm/containerd.spec @@ -117,7 +117,8 @@ rm -f bin/containerd-stress bin/containerd --version bin/ctr --version -make -C /go/src/github.com/opencontainers/runc BINDIR=%{_builddir}/bin runc install +# Unset the VERSION variable as it's meant for containerd's version, not runc. +env -u VERSION make -C /go/src/github.com/opencontainers/runc BINDIR=%{_builddir}/bin runc install %install