Frommi / miniz_oxide

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

Cannot build in `-Z build-std` with `#![no_std]` #106

Closed nbdd0121 closed 2 years ago

nbdd0121 commented 2 years ago

I tried to depend on miniz_oxide on a #![no_std] crate with -Z build-std option used for buidling. However miniz_oxide will depend on std instead of alloc due to cuviper/autocfg#34.

Perhaps it'll be better to detect presence of alloc by rust version instead?

oyvindln commented 2 years ago

I think autocfg was used as it was the most straight forward way to support older releases where alloc didn't yet exist, but maybe we could do a minimum version bump or something now.

nbdd0121 commented 2 years ago

Rust 1.36 is released in 4 July 2019, so a MSRV bump doesn't sound too bad. Does miniz_oxide has a MSRV policy?

oyvindln commented 2 years ago

Previously we've gone with wanting to support at least the version available in stable debian, so bumping to 1.36 should be no issue. Current debian 11 has 1.48, prev debian 10 has 1.41. Should probably do a version bump for it though since the MSRV changes.

oyvindln commented 2 years ago

Ok, latest commit removes autocfg entirely, MSRV is bumped to 1.40 rather than 1.36 to also be able to use non_exhaustive. Can you check if this fixes the problem?

Will put up a new release soon, but going to have a quick look at whether I can include a fix/update to first #105 since we're bumping the version.

nbdd0121 commented 2 years ago

I can confirm that it's fixed.