Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sha2 = "0.10.6"
tar = "0.4.46"
tempfile = "3.27.0"
thiserror = "2.0.21"
zip = { version = "8.6.0", features = ["deflate"], default-features = false }
zip = { version = "8.6.0", features = ["deflate", "lzma"], default-features = false }
zstd = { version = "0.14.0", features = ["experimental", "zstdmt"] }

[dev-dependencies]
Expand Down
Binary file added src/util/testdata/lzma.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions src/util/unarchive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,23 @@ where
archive.set_preserve_mtime(true);
archive.unpack(destination_dir)
}

#[cfg(all(test, not(dotslash_internal)))]
mod tests {
use std::io::Cursor;

use super::*;

#[test]
fn unarchive_zip_lzma() {
// Created with `7z a -tzip -mm=LZMA`, so the entry uses zip compression
// method 14.
let zip = Cursor::new(&include_bytes!("testdata/lzma.zip")[..]);
let dest = tempfile::tempdir().unwrap();
unarchive(zip, dest.path(), ArchiveType::Zip).unwrap();
assert_eq!(
std::fs::read_to_string(dest.path().join("hello.txt")).unwrap(),
"hello lzma zip\n".repeat(40),
);
}
}
3 changes: 3 additions & 0 deletions website/docs/dotslash-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ properties:
| `zst` | no | zstd |
| _omitted_ | no | _none_ |

A `zip` archive can use the store, deflate, or LZMA (method 14) compression
methods for its entries.

An artifact is either an _archive_ (such as a `.tar` file) or a _single file_.

### Path
Expand Down