Dockerfile: build runc 1.5 with libpathrs - #6908
Draft
AkihiroSuda wants to merge 3 commits into
Draft
AkihiroSuda wants to merge 3 commits into
AkihiroSuda wants to merge 3 commits into
Conversation
AkihiroSuda
commented
Jun 29, 2026
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda
force-pushed
the
runc-1.5
branch
from
September 7, 2026 15:02
58c848a to
4c2998c
Compare
AkihiroSuda
force-pushed
the
runc-1.5
branch
from
September 8, 2026 02:37
4c2998c to
6e8ae25
Compare
AkihiroSuda
commented
Sep 8, 2026
| # declares __fsword_t as u32 there while the fstatfs magic constants are u64. | ||
| # Build runc without libpathrs on s390x until that is fixed upstream. | ||
| if [ "$(xx-info arch)" = "s390x" ]; then | ||
| export RUNC_BUILDTAGS=-libpathrs |
Member
Author
There was a problem hiding this comment.
AkihiroSuda
commented
Sep 8, 2026
| # release, so sync the single affected file from the libpathrs checkout. | ||
| # Drop this once runc vendors go-pathrs v0.2.6 (opencontainers/runc#5449). | ||
| if grep -qx "# cyphar.com/go-pathrs v0.2.5" vendor/modules.txt; then | ||
| cp libpathrs/go-pathrs/internal/libpathrs/libpathrs_linux.go vendor/cyphar.com/go-pathrs/internal/libpathrs/ |
Member
Author
There was a problem hiding this comment.
AkihiroSuda
force-pushed
the
runc-1.5
branch
from
September 8, 2026 07:04
6e8ae25 to
fac3bac
Compare
The case differs depending on whether libpathrs is enabled in runc Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
runc 1.5 depends on libpathrs, so build and install it before compiling runc statically. This requires several adjustments for cross-compilation: - Install cargo/rust for the build (native) arch via apk; only the target libraries go through xx-apk, otherwise the toolchain cannot run. - Pass --rust-target to install.sh, since xx-cargo builds into target/<triple>/release rather than target/release. - Install into the xx sysroot (DESTDIR) so xx's cross pkg-config finds pathrs.pc, and --disable-dynamic since the static build only needs the .a (Alpine's BusyBox install also lacks the -T flag used for the .so). - Set RISCV64_TARGET_ARCH=riscv64 for the libpathrs build. Alpine's rustc knows riscv64-alpine-linux-musl, while xx-cargo defaults to the rustup-style riscv64gc-alpine-linux-musl, for which there is no target specification. - Sync go-pathrs to v0.2.6 in runc's vendor tree. runc 1.5.1 vendors v0.2.5, which does not compile with clang: CGo resolves the PATHRS_PROC_* constants to unsigned values that overflow int64. Fixing that is the only change in v0.2.6, so copying the single affected file out of the libpathrs checkout is equivalent to the module bump. This can be dropped once runc vendors v0.2.6 (opencontainers/runc#5449). Note that patching the vendor tree makes runc report itself as -dirty. - Skip libpathrs on s390x. rustix's linux_raw backend declares __fsword_t as u32 there while its fstatfs magic constants are u64, so libpathrs 0.2.6 does not compile for s390x-musl at all. Verified by building the runc stage for all six linux platforms. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda
force-pushed
the
runc-1.5
branch
from
September 8, 2026 07:05
fac3bac to
bd3d412
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
runc 1.5 depends on libpathrs, so build and install it before compiling runc statically. This requires several adjustments for cross-compilation: