Skip to content

fix(26.04): rosetta tar shim - #30

Merged
lczyk merged 10 commits into
mainfrom
fix/rosetta-tar
Aug 1, 2026
Merged

fix(26.04): rosetta tar shim#30
lczyk merged 10 commits into
mainfrom
fix/rosetta-tar

Conversation

@lczyk

@lczyk lczyk commented Aug 1, 2026

Copy link
Copy Markdown
Owner

chisel-releases spread on macOS dies with "Cannot allocate docker:ubuntu-26.04-amd64" after too many retries, with a wall of /bin/tar: ... Cannot mkdir: Function not implemented above it. ubuntu 26.04's SRU'd tar cannot extract anything below the top level in an amd64 container on apple silicon. it's the ubuntu patch specifically -- not tar 1.35, not qemu (will report):

26.04 amd64, tar 1.35+dfsg-4ubuntu0.2 (base image)      ./sub/b.txt: Cannot open:
Function not implemented
26.04 amd64, tar 1.35+dfsg-4ubuntu0.4 (26.04-updates)   ./sub/b.txt: Cannot open:
Function not implemented
26.04 amd64, tar 1.35+dfsg-4          (release pocket)  rc=0
22.04 / 24.04 / 25.10 / 26.10 amd64                     rc=0
26.04 s390x + ppc64le (qemu), 26.04 arm64 (native)      rc=0

the hardening that SRU added resolves paths through a syscall rosetta doesn't implement, so any entry with a directory component fails with ENOSYS, mkdir and open alike. not seccomp (--privileged and seccomp=unconfined both still fail), not the archive format (gnutar / ustar / pax identical), not fixable by pre-creating the dirs, and no gnu tar flag avoids it (-P, --no-overwrite-dir, --delay-directory-restore, -U, ... all still rc=2, TAR_OPTIONS included). bsdtar and busybox tar are both fine.

no repack-side fix: repack rewrites the archive host-side.

fix here

/usr/bin/tar in the bread images is now a shim (hack/tar-shim.sh), real binary diverted to /usr/bin/tar.distrib via dpkg-divert --local --rename. it probes gnu tar once per container (cached in /run) and routes extraction to bsdtar --no-xattrs --no-mac-metadata iff the probe fails. on an unaffected host it's inert and every call is plain gnu tar.

(lots of) drivebys

  • repack improvements.
  • sshd wait was unbounded. its bounded now.
  • worker counter (.spread-worker-num) was written into the cwd spread runs got packed into the project tarball on consecutive runs. minor but polish.
  • discard used to inspect every container on the host, twice. now we just filter better with docker ps
  • make nuke-spread is more selective.

lczyk added 7 commits July 31, 2026 18:24
COPYFILE_DISABLE only drops the AppleDouble sidecars; the xattrs survive as
pax headers and GNU tar warns about each one on unpack.
The dotglob glob is empty in that case and tar exits with 'no files or
directories specified'. Packing '.' also drops the bash-ism.
It was created in the cwd spread runs from, so it landed in the user's repo
and got packed into the project tarball.
The unbounded loop kept polling a container that had already died, so the
failure surfaced as spread's allocate timeout with nothing about why.
The scan inspected every container on the host, twice each, on every discard.
One docker call now covers the lookup, and the label keeps unrelated
containers out of the match.
Ubuntu 26.04's patched tar cannot extract anything below the top level under
Rosetta, which spread reports as a failure to allocate the system. The shim
probes once per container and only reroutes extraction; creation stays on GNU
tar for --sort=name.
@lczyk lczyk changed the title fix: rosetta tar shim fix++: rosetta tar shim Aug 1, 2026
@lczyk lczyk changed the title fix++: rosetta tar shim fix: rosetta tar shim Aug 1, 2026
lczyk added 3 commits August 1, 2026 09:13
The shim swapping tar out from under the container was invisible; allocate now
probes it (warming the cache too) and says so.
A grep for 'bread' in docker ps also matched containers this project never
created. Match the allocate label, plus the bread- name prefix for containers
allocated before the label existed.
@lczyk lczyk changed the title fix: rosetta tar shim fix(26.04): rosetta tar shim Aug 1, 2026
@lczyk
lczyk merged commit 7d7f775 into main Aug 1, 2026
6 checks passed
@lczyk
lczyk deleted the fix/rosetta-tar branch August 1, 2026 09:32
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