-
Notifications
You must be signed in to change notification settings - Fork 23
Use extractcode as stopgap for decompression/extraction #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
WorkingRobot
wants to merge
13
commits into
main
Choose a base branch
from
use-extractcode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+185
−43
Conversation
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
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
nightlark
reviewed
Jul 29, 2025
Collaborator
nightlark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR mostly needs conflicts resolved from the file type id changing to support a list of potential types.
From what I recall, we'd also talked about making a change to the upstream extractcode project?
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.
Summary
If merged this pull request will add support for a plethora of compression types and archive formats as a best-effort stopgap until we decide to add support for these formats manually (if necessary) to add metadata or version info (e.g. the RPM files that @matthewkelley22 is working on).
Proposed changes
Removes the .rar file decompression things and replaces it entirely with
extractcode. Added an additional featureextractcode-fullthat adds 7zip and libarchive binaries as dependencies instead of needing to rely on them existing on the PATH. Ideally, we'd want to have this hook run last, but I don't think pluggy supports that. I also injected .wim support to extractcode just to see what Surfactant can do a Windows 11 iso.Future Work
Seeing how extractcode identifies binaries, it seems to use typecode, which internally uses the same library that the linux
filecommand uses. This may be a better approach to ID-ing files than what we're currently doing with manually checking header bytes (maybe only do this with more specific or lesser-known file types?). Depending on how extractcode behaves, we may want to also look at removing some of the tar/gz/zip/bz file extraction and letting extractcode handle it (unless we have a reason to look at the file metadata directly).