fix: bz3 is missing from SUPPORTED_EXTENSIONS - #1050
Open
VXNCXNX wants to merge 1 commit into
Open
Conversation
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.
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.
What's broken
bz3is missing fromSUPPORTED_EXTENSIONS, althoughslice_to_extensionparses it andPRETTY_SUPPORTED_EXTENSIONSadvertises it. The "insert an archive format" hint walks that list, so it does not see thebz3boundary and suggests a path ouch then refuses.Repro
Following the old hint verbatim:
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.bz3andlinux.bz3.gz. The other walks every extension inPRETTY_SUPPORTED_EXTENSIONS, skips the archive-first ones, and asserts the rest are inSUPPORTED_EXTENSIONS, so a future addition cannot go missing the same way. Removingbz3again 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 --checkandcargo clippy --all-targets -- -D warningsclean. I built withbzip3off, sincelibbzip3-sysdoes not compile here (missingstddef.h); that only affects whether the resulting archive can be written, not the extension bookkeeping this changes.tbz2andtbz3are parsable but absent fromSUPPORTED_ALIASES. They are archive-first, so the suggestion path never consults them, and I left them alone to keep this to one concern.