Skip to content

v0.56.1

Latest

Choose a tag to compare

@stuartwdouglas stuartwdouglas released this 24 Nov 03:45
b431112
fix: skip pax global headers when extracting tarballs (#650)

`archive/tar` returns a pax global header (typeflag `g`) as an ordinary
entry. `extractPackageTarball` had no case for it, so the entry fell
through to the regular-file branch and was written out as
`pax_global_header` with the header's mode.

GitHub release tarballs carry one of these. For polykite 0.167.0
(squareup/hermit-packages) it lands as
`pkg/polykite-0.167.0/pax_global_header` with mode `----------`.
Anything that later reads the whole Hermit cache then fails. In our case
a `tar -cpf - -C ~/.cache/hermit -- environments metadata pkg` cache
save exits 2 with `Cannot open: Permission denied`, so the cache is
never written.

This change skips `tar.TypeXGlobalHeader` entries.
`TestExtractPackageTarballSkipsPaxGlobalHeader` fails without the change
("pax global header was extracted as a file") and passes with it.

Packages that are already installed keep the stray file until they're
reinstalled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>