Skip to content

Conversation

@dcantah
Copy link
Contributor

@dcantah dcantah commented Jan 13, 2026

Swift does not have a native tar reader/writer, and we'd really like to avoid linking more (libarchive) libraries to vminitd if we can get away with it. For copying directories into/out of containers tar is fairly nice as it's a simple way to preserve everything you need to be able to reassemble the directory on the receiving end. Due to this, I decided to write a somewhat simple tar reader/writer solely for this purpose. Unfortunately, there's quite a lot of work to get vminitd/ to compile on macOS without the static linux SDK, so it was making unit testing these additions quite a pain, so for now the new work lives in _ContainerizationTar (where the underscore is trying to denote that this is rather experimental..).

This change aims to add a simple tar reader and writer with support for pax extended headers (for long file names and > 8 GiB files). Because its intended purpose is in a scenario where we own both the creator and ingestor, the reader does NOT handle every case, but it is good at unarchiving the archives the library has made :)

Swift does not have a native tar reader/writer, and we'd really
like to avoid linking more (libarchive) libraries to vminitd if we can get
away with it. For copying directories into/out of containers tar
is fairly nice as it's a simple way to preserve everything you need
to be able to reassemble the directory on the receiving end. Due to this,
I decided to write a somewhat simple tar reader/writer solely for this
purpose. Unfortunately, there's quite a lot of work to get vminitd/ to
compile on macOS without the static linux SDK, so it was making unit testing
these additions quite a pain, so for now the new work lives in _ContainerizationTar
(where the underscore is trying to denote that this is rather experimental..).

This change aims to add a simple tar reader and writer with support pax extended headers
(for long file names and > 8 GiB files). Because its intended purpose is in a
scenario where we own both the creator and ingestor, the reader does NOT handle every
case, but it is good at unarchiving the archives the library has made :)
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