-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib-rs and cloudflare_zlib features conflict #440
Comments
Thanks for reporting and for the initial analysis! A PR to setup such precedence would definitely be welcome |
Is there still a need to keep the cloudflare feature at all or could we just make it an alias to one of the zlib_ng variants for backwards compatability since zlib_ng incorporates the improvements from that fork anyhow? (or at least consider that in the next version that allows breakage) |
Thanks for pointing that out! |
strictly speaking the zlib-ng readme is a bit unclear whether it's some or all but since it's performance improvements and not any extra functionality it might not be worth supporting both if zlib-ng (or the rust port) performs as good or better anyhow and cloudflare-zlib has more limited hardware support and sees much less updates. (One thing I don't know is whether it also makes the tradeoff of limiting to matches to a min length of 4 and thus achieves slightly less efficient compression in some cases compared to vanilla zlib like zlib-ng does so if somehow anyone relies on that that would be a counterpoint.) |
This isn't a fundamental conflict between the crates, only a cloudflare-zlib is a drop-in replacement for the original C zlib (it has the same C API/ABI). As long as you support the original zlib, supporting cloudflare-zlib should be easy. cloudflare-zlib is similar to zlib-ng, but it's easier to build (and cross-compile) in Rust, because it uses the |
If you try to enable both the zlib-rs and cloudflare_zlib features:
Then there are some compile errors:
I believe this is can be fixed by establishing precedence between the two flags here:
flate2-rs/src/ffi/c.rs
Lines 408 to 412 in 14aec22
The text was updated successfully, but these errors were encountered: