kornelski / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml
https://lib.rs/cargo-deb
MIT License
404 stars 48 forks source link

Consider using `zopfli`'s new streaming encoder feature #100

Open AlexTMjugador opened 1 year ago

AlexTMjugador commented 1 year ago

I've just noticed that cargo-deb stopped using Zopfli in this commit because its API did not properly support streaming compression at the time. However, Zopfli 0.7.4 was released a little while ago with such support. If that limitation was the only reason to stop using Zopfli, you might want to give the new version a try! :smile:

kornelski commented 1 year ago

Zopfli is super useful in places where gzip has to be used, like PNG. However, dpkg has supported xz for a long time now, and xz is a pareto improvement over gzip in speed and compression. Therefore, for cargo-deb I consider gzip support only a low-priority fallback for a small and decreasing number of very old Debian installs.

AlexTMjugador commented 1 year ago

That makes sense, thanks for the clarification! I wouldn't mind cobbling together a PR to reintroduce Zopfli when I have time, but feel free to close this issue if you feel Zopfli is no longer in scope for the project.

kornelski commented 1 year ago

Yes, I'm happy to accept a PR for this.

AlexTMjugador commented 1 year ago

I had some time to ponder this idea and realized that to implement it well I would need to extend the zopfli crate API with a writer that outputs data in Gzip format, since wrapping a DEFLATE stream in a Gzip container is a responsibility that should not belong to this crate. After that, I will consider visiting this enhancement again :slightly_smiling_face: