Skip to content

Comments

build: use libpathrs by default#5103

Draft
cyphar wants to merge 9 commits intoopencontainers:mainfrom
cyphar:libpathrs-by-default
Draft

build: use libpathrs by default#5103
cyphar wants to merge 9 commits intoopencontainers:mainfrom
cyphar:libpathrs-by-default

Conversation

@cyphar
Copy link
Member

@cyphar cyphar commented Feb 8, 2026

Draft until these PRs / issues are resolved and libpathrs has a new release:


pathrs-lite supports transparently switching to libpathrs.so as a backend
with the libpathrs build tag. In order to permit us to eventually require
libpathrs.so (and get rid of some of the duplicated wrappers in
internal/pathrs), we need to make libpathrs opt-out for at least one
release before making it mandatory.

Signed-off-by: Aleksa Sarai cyphar@cyphar.com

@cyphar cyphar added this to the 1.5.0-rc.1 milestone Feb 8, 2026
@cyphar cyphar force-pushed the libpathrs-by-default branch 4 times, most recently from d8dd6b0 to 11671a9 Compare February 8, 2026 23:32
run: cargo install --locked cargo-auditable
- name: install libpathrs
env:
LIBPATHRS_VERSION: "0.2.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the matrix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, I'm just trying to validate that cyphar/libpathrs#327 is sufficient to make runc builds happy (both with make releaseall and in GHA). I also still need to set up signed release archives and switch script/build-libpathrs.sh back to pulling from a release as well.

@cyphar

This comment was marked as resolved.

@cyphar cyphar force-pushed the libpathrs-by-default branch 7 times, most recently from af83d54 to d25c6d6 Compare February 11, 2026 13:45
Comment on lines 81 to 86
- uses: dtolnay/rust-toolchain@stable
- name: install libpathrs v${{ matrix.libpathrs-version }}
env:
LIBPATHRS_VERSION: (${{ matrix.libpathrs-version }})
run: |
sudo -E PATH="$PATH" ./script/build-libpathrs.sh "$LIBPATHRS_VERSION" /usr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can set up OBS to build (and serve) libpathrs deb packages, similar to how it's currently done for criu? This will save a lot of hassle (in this repo, not for you I'm afraid). We can probably also reuse this from Dockerfile, too, eliminating the need for script/build-libpathrs.sh (the seccomp one is really needed as we have to include the sources, and there's no such requirement for libpathrs IMO).

Copy link
Member Author

@cyphar cyphar Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking about doing that to be honest, but was hoping to be able to do this later rather than upfront (I don't mind maintaining unofficial packages for this stuff eventually but learning Rust packaging for 3-4 different distros as a prerequisite for this PR seems a little harsh 😅).

eliminating the need for script/build-libpathrs.sh (the seccomp one is really needed as we have to include the sources, and there's no such requirement for libpathrs IMO).

libpathrs is MPLv2 (or LGPLv3), so we do need to include a copy of the sources.

Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly LGTM. I like that it is basically contained on the CI/release files. Ping me when you want another review.

I left some comments. I think I'd nto try to figure out the "correct" location for a library on each distro, if something like /usr/local works on all. I'd let the right destdir to when we have an OBS package for each distro or so. But I feel usr/local probably doesn't work?

Left some other comments too, mostly nits.

@cyphar cyphar force-pushed the libpathrs-by-default branch from d25c6d6 to dbdd4c2 Compare February 13, 2026 06:50
@cyphar cyphar force-pushed the libpathrs-by-default branch from dbdd4c2 to cf68c86 Compare February 13, 2026 06:57
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Debian 13 (trixie) was released a few months ago and it's probably
prudent to just upgrade. This is also necessary to get access to riscv64
repositories when we build libpathrs for inclusion in our runc binaries.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
The intention of commit 531e29e ("script/lib.sh: set GOARM=5 for
armel, GOARM=6 for armhf") was to properly support older ARM platforms
with our release builds.

However, we have never been able to support ARMv6 for our builds because
we use the Debian compiler to build the libseccomp we statically compile
into our binaries and (as per the now-deleted comment itself) Debian
treats armhf as being ARMv7 so the final binaries we produced were
always only ever compatible with ARMv7+.

This was a bit of an oddity before but when building libpathrs for
releases we will need to use Rust which makes the target more explicit
(and while it does support armhf, we are using the Debian-packaged Rust
cross-compiler and thus are in the same dilemma with what Debian
considers "armhf" to be).

All-in-all, it's better to just bite the bullet and just follow Debian
here properly.

Fixes: 531e29e ("script/lib.sh: set GOARM=5 for armel, GOARM=6 for armhf")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This name is far more descriptive.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar cyphar force-pushed the libpathrs-by-default branch 2 times, most recently from 35783a2 to 95a8a72 Compare February 13, 2026 07:49
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar cyphar force-pushed the libpathrs-by-default branch from 95a8a72 to c92bbc6 Compare February 13, 2026 14:00
@cyphar
Copy link
Member Author

cyphar commented Feb 14, 2026

What the heck...

=== RUN   TestBindMountAndUser
    exec_test.go:1819: unexpected error:
      unable to start container process:
      error during container init:
      error mounting "proc" to rootfs at "/proc":
      cannot re-open [12]"/tmp/TestBindMountAndUser164197807/002" with O_DIRECTORY:
      get safe procfs handle:
      open fd 13 fdinfo:
      open raw procfs subpath failed:
      openat2([13]"/proc", "./thread-self/fdinfo/13", { flags: OpenFlags(O_CLOEXEC | O_NOFOLLOW | O_NOCTTY), resolve: ResolveFlags(RESOLVE_BENEATH | RESOLVE_NO_MAGICLINKS | RESOLVE_NO_XDEV) }, 24):
      Permission denied (os error 13)
--- FAIL: TestBindMountAndUser (0.08s)

🤨

Hmmmm, this is probably caused by the annoying procfs behaviour with user namespaces and non-dumpability... (ptrace_may_access would allow access but procfs DAC permissions block it.)

I guess in the case where we would accept no mnt_id we can also accept non-dumpable blocking access to fdinfo...? Ew...

@cyphar cyphar force-pushed the libpathrs-by-default branch from c92bbc6 to 6a0a073 Compare February 15, 2026 07:50
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar cyphar force-pushed the libpathrs-by-default branch from 6a0a073 to bd15ac1 Compare February 15, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants