emmatyping · GitHub

Feature or enhancement

The Trifecta Tech Foundation has sponsored work on Rust re-implementations of zlib and libbzip2.

These implementations are as fast or faster than their C counterparts (including zlib-chromium and zlib-ng). zlib-rs has seen adoption in Firefox, cargo, and many other major tools, including uv. These implementations are also "drop-in" replacements - they just require slight adjustment to linker arguments.

I think adding support for linking against zlib-rs and libbzip2-rs should be easy to do and maintain, and enable safer builds of CPython.

Eventually (not proposing this yet!), perhaps we could use zlib-rs for Windows builds to provide greater memory safety.

Related issue discussing supporting zlib-ng (mostly Unix build support is left): #91349

I have a draft PR with an implementation below:

Linked PRs

Read the original on github.com ↗