rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

Improve xz support in TarFileWriter

Open jbgosselin opened this issue 1 year ago • 2 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] Other... Please describe:

What is the current behavior?

I'm using nix with home-manager, and my binaries doesn't live in a "conventional" folder. It seems that the actual tooling succeeds to find xz_path but fails detect xzcat or when trying to directly use xz in a subprocess. With xzcat in a non conventional folder but in PATH, the archive.py fails with xzcat not found.

What is the new behavior?

Since the path of xz is properly found in build_tar.py, provide the path for xz to archive.py and replace usage of xz and xzcat with the provided path.

Also added support for lzma in archive.py in a similar fashion than build_tar.py.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

I was wondering if this should be replaced with proper settings given to tarfile or directly using lzma python library. I feel that it is not well supported in python2, but do we still support python2 ?

jbgosselin avatar Mar 06 '23 22:03 jbgosselin

This Pull Request has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

github-actions[bot] avatar Sep 05 '23 02:09 github-actions[bot]

Not stale

jbgosselin avatar Sep 05 '23 03:09 jbgosselin