fix(pkg): pass explicit -z/-j flags for non-auto-detecting tar#13688
Open
Alizter wants to merge 1 commit intoocaml:mainfrom
Open
fix(pkg): pass explicit -z/-j flags for non-auto-detecting tar#13688Alizter wants to merge 1 commit intoocaml:mainfrom
Alizter wants to merge 1 commit intoocaml:mainfrom
Conversation
f154c1c to
c75647a
Compare
Collaborator
|
What about archives that are compressed with |
Collaborator
Author
|
I think supporting these compression formats explicitly should be a separate issue. Can you open an issue (for each)? |
Collaborator
Leonidas-from-XIV
requested changes
Mar 4, 2026
c75647a to
0e10e56
Compare
OpenBSD tar doesn't auto-detect compression format and requires explicit -z (gzip) or -j (bzip2) flags. This adds tar implementation detection via --version output: - 'bsdtar' or 'libarchive' -> BSD tar (auto-detects compression) - 'GNU tar' -> GNU tar (auto-detects compression) - Otherwise -> Other (needs explicit flags) Fixes ocaml#10123 Signed-off-by: Ali Caglayan <alizter@gmail.com>
0e10e56 to
0319572
Compare
Leonidas-from-XIV
requested changes
Mar 4, 2026
| (* CR-soon alizter: handle .tar.xz (-J) and .tar.lzma (--lzma) which | ||
| OPAM also supports. Should error with a clear message if the tar | ||
| implementation doesn't support auto-detection for these formats. *) | ||
| [] |
Collaborator
There was a problem hiding this comment.
I still think that throwing an User_error here is better since in this code branch we're dealing with e.g. OpenBSD tar which just doesn't support -J or --lzma. Thus returning [] will just make it fail later on, when tar xf archive.tar.xz happens. Here we can at least error out with a better error message ("Your tar does not support XZ decompression" "Hint: Install libarchive bsdtar maybe").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenBSD tar doesn't auto-detect compression format and requires explicit -z (gzip) or -j (bzip2) flags.
This adds tar implementation detection via --version output:
Fixes #10123