Skip to content

Conversation

@Alizter
Copy link
Collaborator

@Alizter Alizter commented Dec 10, 2025

We rewrite the extraction capabilities for package management, enforcing the invariants we wish to preserve at the type level. The aim is to separate the concerns of finding an appropriate archive binary, checking the capabilities of this binary, creating arguments for this binary and invoking this for extraction.

The public API of extraction is still simple, so the typed invariants are more of an internal impelementation detail.

A sumamry of the changes are as follows:

We rewrite the extraction capabilities for package management, enforcing
the invariants we wish to preserve at the type level. The aim is to
separate the concerns of finding an appropriate archive binary, checking
the capabilities of this binary, creating arguments for this binary and
invoking this for extraction.

The public API of extraction is still simple, so the typed invariants
are more of an internal impelementation detail.

A sumamry of the changes are as follows:

- Use GADTs to encode which formats each tar implementation supports,
  preventing invalid combinations at compile time
- Detect tar implementation (BSD/GNU/Other) via --version output
- Prefer BSD tar over unzip for zip extraction
- Check bsdtar before tar to get more capable implementation
- Add gtar to binary list for GNU tar on macOS/BSD
- Pass explicit -z/-j flags for OpenBSD/busybox tar

Signed-off-by: Ali Caglayan <[email protected]>
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.

If dune tools install fails to install a tool it can break a user's environment tar on OpenBSD Fetch Zip Archives

1 participant