Skip to content

Extract cross toolchains with --no-same-owner for rootless podman#9

Merged
lacraig2 merged 3 commits into
mainfrom
rootless-podman-no-same-owner
Jun 17, 2026
Merged

Extract cross toolchains with --no-same-owner for rootless podman#9
lacraig2 merged 3 commits into
mainfrom
rootless-podman-no-same-owner

Conversation

@lacraig2

Copy link
Copy Markdown
Collaborator

Problem

The cross-toolchain tarballs (musl.cc, panda.re) are packed with the upstream maintainer's uid/gid — e.g. 98601130:98600513. tar -xz preserves that ownership, so the built image contains files owned by those very high IDs.

Under docker this is harmless. Under rootless podman it's fatal: pulling/unpacking the image into the user namespace fails because those IDs exceed the user's /etc/subuid//etc/subgid range:

error processing tar file: potentially insufficient UIDs or GIDs available in
user namespace (requested 98601130:98600513 for /opt/cross/mipseb-linux-musl):
Check /etc/subuid and /etc/subgid

This blocks any rootless-podman build of the penguin image (which does FROM rehosting/embedded-toolchains AS cross_builder).

Fix

Add --no-same-owner to every cross-toolchain tar extraction (17 /opt/cross extractions + the loongarch /tmp one). Extracted files are then owned by the build user (root, id 0) instead of the upstream IDs.

  • Functionally identical image — only file ownership metadata changes (everything is root-owned, which is what you want anyway).
  • Makes the image pull/run/build under rootless podman with no per-host /etc/subuid widening — i.e. the image "runs in more places."

Verification

Built the full image under rootless podman (podman 3.4.4 / buildah 1.23.1): it completed all 53 assembly steps + rust targets (Successfully tagged), where the unpatched image couldn't even be unpacked rootless. The penguin image then built on top of it under rootless podman and ran an x86_64 KVM emulation to completion.

lacraig2 added 3 commits June 16, 2026 22:41
The musl.cc / panda.re cross-toolchain tarballs are packed with the upstream
maintainer's uid/gid (e.g. 98601130:98600513). `tar -xz` preserves that
ownership, so the resulting image has files owned by those very high IDs.

Under docker this is harmless, but it breaks rootless podman: pulling/unpacking
the image into a rootless user namespace fails because those IDs exceed the
user's /etc/subuid|subgid range:

  potentially insufficient UIDs or GIDs available in user namespace
  (requested 98601130:98600513 ...): Check /etc/subuid and /etc/subgid

Add --no-same-owner to every cross-toolchain extraction so the files are owned
by the build user (root, id 0) instead. The image is functionally identical and
now pulls/runs/builds under rootless podman without requiring every host to
widen its subuid range.
musl.cc blocks GitHub-hosted runner IP ranges wholesale (since 2025-05-27), so
the cross-toolchain `wget https://musl.cc/...` steps fail on ubuntu-latest:

  Connecting to musl.cc (musl.cc)|216.82.192.11|:443...   (stalls)
  ERROR: ... wget https://musl.cc/powerpc64-linux-musl-cross.tgz ... exit code 2

Move the PR check to the self-hosted rehosting-arc runners (whose egress isn't
blocked), mirroring publish.yml: trust the Harbor cert, log in, set up buildx
with the insecure-registry config, pull base images via the Harbor proxy, and
read the publish layer cache so unchanged layers don't re-download. Builds the
`final` target to validate; does not push (PR check).
@lacraig2 lacraig2 merged commit aaf679f into main Jun 17, 2026
1 check passed
@lacraig2 lacraig2 deleted the rootless-podman-no-same-owner branch June 17, 2026 17:47
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.

1 participant