This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make zlib required on all platforms (simplifies code)
Type: Stage: patch review
Components: Build, Extension Modules, Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: gregory.p.smith
Priority: normal Keywords: patch

Created on 2022-03-22 08:38 by gregory.p.smith, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 32043 open gregory.p.smith, 2022-03-22 08:40
Messages (2)
msg415750 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-03-22 08:38
We have a pile of conditionals and extra code in CPython to deal with building on systems that do not have zlib.  The zlib C library has been around forever at this point and should be present on every system in the world.

zlib is already required on Windows to build CPython.

Proposal: simplify our code by removing the conditionals around zlib being optional.  I'm attaching a draft PR to show what this would look like.
msg415809 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-03-22 20:08
Bringing this up on discord, others point out that the windows build requires zlib for convenience when we transitioned from having a vendored copy in our repo and that smaller "embedded" use cases may not like this if they don't already need the dep. But there have been no complaints about it on the Windows side.

`binascii.crc32` was one thing that motivated me to look into "just require zlib" to get out of carrying our own suboptimal crc32 code.  along those lines, we should recommend people choose https://github.com/zlib-ng/zlib-ng rather than zlib.net for better performance.

looking over my PR, it can make for some awkward code with zlib right next to others that we treat as optionals.  good bad or indifferent?  i'm leaning towards indifferent and still enjoying fewer lines of code.
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91246
2022-03-22 20:08:54gregory.p.smithsetmessages: + msg415809
2022-03-22 08:40:00gregory.p.smithsetkeywords: + patch
pull_requests: + pull_request30133
2022-03-22 08:38:53gregory.p.smithcreate