Skip to content

fix: bz3 is missing from SUPPORTED_EXTENSIONS - #1050

Open
VXNCXNX wants to merge 1 commit into
ouch-org:mainfrom
VXNCXNX:fix/bz3-missing-from-supported-extensions
Open

fix: bz3 is missing from SUPPORTED_EXTENSIONS#1050
VXNCXNX wants to merge 1 commit into
ouch-org:mainfrom
VXNCXNX:fix/bz3-missing-from-supported-extensions

Conversation

@VXNCXNX

@VXNCXNX VXNCXNX commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What's broken

bz3 is missing from SUPPORTED_EXTENSIONS, although slice_to_extension parses it and PRETTY_SUPPORTED_EXTENSIONS advertises it. The "insert an archive format" hint walks that list, so it does not see the bz3 boundary and suggests a path ouch then refuses.

Repro

$ ouch compress folder out.bz3.gz
before:  hint: To:   "out.bz3.tar.gz"
after:   hint: To:   "out.tar.bz3.gz"

Following the old hint verbatim:

$ ouch compress folder out.bz3.tar.gz
[ERROR] File extensions are invalid for operation
 - The archive extension '.tar' can only be placed at the start of the extension list

So the hint pointed at a path ouch rejects on its own terms.

The fix

One entry added to SUPPORTED_EXTENSIONS.

Verification

Two tests. One pins the suggestion for linux.bz3 and linux.bz3.gz. The other walks every extension in PRETTY_SUPPORTED_EXTENSIONS, skips the archive-first ones, and asserts the rest are in SUPPORTED_EXTENSIONS, so a future addition cannot go missing the same way. Removing bz3 again fails both, the second with the name of the offending extension.

Output above is from binaries built before and after, not from the unit tests.

Full suite passes. cargo fmt --check and cargo clippy --all-targets -- -D warnings clean. I built with bzip3 off, since libbzip3-sys does not compile here (missing stddef.h); that only affects whether the resulting archive can be written, not the extension bookkeeping this changes.

tbz2 and tbz3 are parsable but absent from SUPPORTED_ALIASES. They are archive-first, so the suggestion path never consults them, and I left them alone to keep this to one concern.

slice_to_extension parses bz3 and PRETTY_SUPPORTED_EXTENSIONS advertises
it, but the suggestion walk consults SUPPORTED_EXTENSIONS, so it did not
recognise the extension and proposed out.bz3.tar.gz, which ouch itself
rejects for a misplaced archive format.
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.

1 participant