Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Flag `miniz_oxide` as a `#![no_std]` library #81

Closed alexcrichton closed 4 years ago

alexcrichton commented 4 years ago

This commit conversion the miniz_oxide crate to a #![no_std] library, and is as a result a breaking change for the library. Currently the only dependency on the std crate is the std::io::Cursor type, which is pretty easily replaced with a usize parameter in a few locations.

The goal of this commit is to eventually enable this library to be included into the standard library itself. Dependencies of the standard library can't depend on the standard library as well! The reason for including this in the standard library is that the backtrace crate wants to decompress DWARF information in executables, which can be compressed with zlib.

alexcrichton commented 4 years ago

I realize that this is a large-ish change to this library, so I'm happy to answer any questions as well about this if y'all have any!

alexcrichton commented 4 years ago

I should also mention that this will need some dependency and feature voodoo to actually enable it to build as part of libstd's dependency chain, but this needs to wait for that PR to be merged/published so it can enable the feature here.

alexcrichton commented 4 years ago

With https://github.com/remram44/adler32-rs/pull/15 merged I've updated the manifest here as well to be suitable for compiling as part of libstd itself.

oyvindln commented 4 years ago

This looks good to me so far.

alexcrichton commented 4 years ago

@oyvindln mind publishing this too to crates.io as 0.4.0 so I can start updating deps to include it for libstd?

oyvindln commented 4 years ago

Will do once I've looked over everything.

oyvindln commented 4 years ago

Okay, it's up, and includes #83

alexcrichton commented 4 years ago

Thanks!