-
Notifications
You must be signed in to change notification settings - Fork 180
Add (de)compress_uninit
that accepts &[MaybeUninit<u8>]
#502
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
Conversation
macOS msrv CI failure is due to cloudflare-zlib-sys, seems unrelated to this PR https://github.com/rust-lang/flate2-rs/actions/runs/18062890552/job/51401644728?pr=502#step:10:283 looks like due to macos-latest is updated with new env, previously it probably does not import This is clearly not something that can be fixed in this repository, ignoreing it might makes more sense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for contributing! To me it seems very valuable to clean up output memory handling to maybe make it more robust thanks to the (to me very magical) MaybeUninit
.
The biggest problem I am having is the MSRV failure, as I don't know why it happens now and what should be done about it. As any cloudflare-zlib or MSRV change should have triggered this back in the day, we may probably assume that the macOS image changed.
Since cloudflare-zlib is on the way out, it might be acceptable to let it rot and disable this particular test for it. But I am not certain the easy way is the good way here.
Yes, it may just be simpler to remove CI on MacOS is giving the error:
|
You're using cloudflare-zlib-sys 0.3.5, and the issue has been fixed in 0.3.6 released in March. The incompatibility with new macOS headers was caused by an obsolete workaround meant for a very ancient MacOS, carried over from old zlib.h. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for everyone's help!
I take it that this PR can be merged as is then, even though I have a few more coment.
Could you also rebase and squash it down a bit?
CI is green now 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank a lot!
Then… let's do it 🙏.
(I am always a bit afraid to merge anything here with my possibly dangerous mix of naiveté and ignorance 😅)
do you have any plan of cutting new release? Not in a rush though |
I had no plans, actually. Maybe we can wait a little longer
There doesn't seem to be too much either. |
Looks like it has some fixes (use cc cuts a new release every week as long as there're changes, not saying flate2 should be as frequent as that, but I think letting commits sit for months without release is actually bad as end users end up waiting really long for improvements in flate2. plus, having less commits per release is good for finding bugs, users who experienced breakage after upgrading can find the culprit commit easier than having a lot. With that says it's my two cents, and I'm not rushed to have this PR released, just my own opinion on release cadence |
Thanks for sharing! Let me try to get better at making releases then :). Oh, and I remember now, I can't approve my own PRs so releasing is a hassle unless it's planned and a version bump is made by someone else. I don't actually know who is associated with this project and hope that everyone who is suggested as reviewer also is allowed to approve PRs here. |
Great - here is the new release: https://github.com/rust-lang/flate2-rs/releases/tag/1.1.3 . |
Thank you! |
The docs.rs build fails brcause doc_auto_cfg has been removed in nightly |
Thanks for reporting! If it was an issue I'd add the"help wanted" label just because I can't merge my own fixes 😅 |
Having a safe API for
MaybeUninit<u8>
would be necessary for async-compression to wrap and reduce the performance penalty of initializing the buffer for alltokio::io::*
traits implementation.Also update
(de)compress_vec
API to use the new API instead of passing a&mut [u8]
which technically violates rust's semantics.NOTE that for
miniz_oxide
implementation, it still zero-initialize theoutput
, since probably no one use it in production and now libz-rs is the go-to high-performance pure-rust implementation I don't see any point in optimizing it.Related PR: trifectatechfoundation/bzip2-rs#147