Skip to content

Support XZ decompression if decompressor is available #13715

@Leonidas-from-XIV

Description

@Leonidas-from-XIV

Expected Behavior

If a package in opam-repository uses .tar.xz and the users system has a decompressor Dune, like OPAM, should be able to unpack it.

Packages that use XZ compressed tarballs in opam-repository include:

  • LLVM
  • Clamgml
  • Topiary
  • A bunch of lesser-known packages

Actual Behavior

At the moment the support is spotty: if the tar implementation can auto-detect .xz files and has a decompressor available (like GNU tar or libarchive's bsdtar) it will work. However if the tar implementation does not support autodetection (e.g. OpenBSD tar, possibly other tar implementations) Dune will fail despite a decompressor existing on the system (and OPAM supporting decompression).

While GNU tar and bsdtar support decompression of xz archives using the -J flag, this flag is not guaranteed to exist, e.g. OpenBSD tar does not have such a flag.

Reproduction

  • PR with a reproducing test:
  1. Use OpenBSD
  2. Attempt to install any dependency that has a tar.xz. archive

Specifications

  • Version of dune (output of dune --version): any
  • Version of ocaml (output of ocamlc --version): any
  • Operating system (distribution and version): OpenBSD

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions