From 4d1132afb4c4f80b54e3a8beeeb02666defc6d4a Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 18 Oct 2026 21:32:36 -0400 Subject: [PATCH] script/setup/install-runc: build runc statically The test tarball from test/build.sh is built on the kubekins image and run on other distros. A dynamic runc built on Debian trixie needs GLIBC_2.38 and fails on AL2023 (kubernetes/kubernetes#142987). Build with `make static` like the runc release binaries. EL has no libseccomp-static, so the Fedora/EL VMs keep the dynamic build via RUNC_DYNAMIC=1. Signed-off-by: Davanum Srinivas (cherry picked from commit ef4b3a331443a39ede2228af4978248acb509423) Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com> --- script/setup/install-runc | 9 ++++++++- script/vm/provision.sh | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/script/setup/install-runc b/script/setup/install-runc index e55f671f58..f9f8956bf3 100755 --- a/script/setup/install-runc +++ b/script/setup/install-runc @@ -38,7 +38,14 @@ function install_runc() { git clone "${RUNC_REPO}" "${TMPROOT}"/runc pushd "${TMPROOT}"/runc git checkout "${RUNC_VERSION}" - env -u VERSION make BUILDTAGS='seccomp' runc + # Static build, like the runc release binaries, so the binary does not + # depend on the build host's glibc and libseccomp. Needs libseccomp.a; + # set RUNC_DYNAMIC=1 where it is not available (e.g. EL). + if [ -n "${RUNC_DYNAMIC:-}" ]; then + env -u VERSION make BUILDTAGS='seccomp' runc + else + env -u VERSION make BUILDTAGS='seccomp' static + fi $SUDO make install popd } diff --git a/script/vm/provision.sh b/script/vm/provision.sh index 5aaac15051..330b7586dd 100755 --- a/script/vm/provision.sh +++ b/script/vm/provision.sh @@ -78,8 +78,9 @@ fi cd "${containerd_dir}" -# Install runc (pass RUNC_FLAVOR=crun to install crun as runc) -RUNC_FLAVOR="${RUNC_FLAVOR}" script/setup/install-runc +# Install runc (pass RUNC_FLAVOR=crun to install crun as runc). +# EL has no libseccomp-static, so build runc dynamically like runc's own CI does. +RUNC_FLAVOR="${RUNC_FLAVOR}" RUNC_DYNAMIC=1 script/setup/install-runc type runc runc --version # "type -ap" may print the same file under multiple names, e.g., on