Skip to content

Support decompression of LZMA compressed tarballs #13716

@Leonidas-from-XIV

Description

@Leonidas-from-XIV

Expected Behavior

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

OPAM supports LZMA archives, however no package currently in opam-repository uses LZMA compressed tarballs. Custom repositories might as the support in OPAM exists since at least OPAM 2.1 (and quite possibly before).

Actual Behavior

At the moment the support is spotty: if the tar implementation can auto-detect .lzma 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.

While GNU tar and bsdtar support decompression of xz archives using the --lzma 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.lzma 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