Skip to content

Commit

Permalink
deb, rpm: fix runc using incorrect version
Browse files Browse the repository at this point in the history
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]: opencontainers/runc@6f4d975

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Aug 6, 2024
1 parent be55b62 commit 1d9c0d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d9c0d6

Please sign in to comment.