Closed abhinav closed 3 months ago
Give me a few days to come up with test fixtures. I need to add some of .zip
and .xz
. Given my past poor experience with this crate, I'd feel more comfortable confirming that the test archives work
Sounds good! Thanks for dropping that note, @zertosh.
https://github.com/facebook/dotslash/releases/tag/v0.2.0 | filename | size |
---|---|---|
dotslash-macos.v0.2.0.tar.gz | 1.01 MB | |
dotslash-ubuntu.v0.2.0.tar.gz | 602 KB | |
dotslash-windows.v0.2.0.tar.gz | 438 KB |
with both xz and zip support from @abhinav, and compress by gzip --best (excluding windows), the new release sizes: https://github.com/datamana-app/dotslash/releases/latest | filename | size |
---|---|---|
dotslash-darwin-aarch64.tar.gz | 538 KB | |
dotslash-darwin-x86_64.tar.gz | 616 KB | |
dotslash-darwin.tar.gz | 1.13 MB | |
dotslash-linux-aarch64.tar.gz | 595 KB | |
dotslash-linux-x86_64.tar.gz | 659 KB | |
dotslash-windows-x86_64.tar.gz | 501 KB |
Just wanted to confirm that this branch also works with deno. It would be great to see it merged into main...
So sorry, I'll give this some time tmw
@zertosh has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Hi. Im interested in trying to adopt this tool for some of our projects. Unfortunately we rely on several things distributed via zip only. Is there any contribution/help that I can provide to get this landed in the main branch?
@zertosh merged this pull request in facebook/dotslash@fb65e2886a1ca05e3b558f0fc396e26bed1908c4.
Sorry this took so long! I had to use an outdated version of the zip
crate because that's what we have internally. I'm in the process of updating that
Similarly to #12, this adds support for .zip archives. Examples of projects using zip only:
The code differentiates between the decompression step (e.g. xz gzip, etc.) and the archive format (e.g. tar, zip). So unlike .tar.gz, this adds a new ArchiveFormat.
In match arms, this adds the possibility of attempting to handle .zip.gz or similar, but that's not allowed at the entry point, so the code errors or panics if it encounters that.
To keep the file size down, the default features of the zip crate were disabled. Namely, support for encrypted archives and bzip2 was left out. Based on my read of this summary of history of archive formats, this configuration should be sufficient for a vast majority of zip files.
There's also a 'time' feature flag that enables integration with the time crate that was also left out.
File size impact:
Currently, this change adds 33,104 bytes to the binary size on macOS. Enabling the (currently disabled) bzip2 feature flag would add another 33,232 bytes. Disabling the (currently enabled) zstd flag does not reduce the file size.
License: zip-rs is licensed under MIT, so it's safe to use here.
Testing: Besides accompanying unit tests, tested manually with the following file per #8:
Resolves #8