Skip to content

Commit 6bd56d7

Browse files
Inital make zlib test required on platforms other than wasi, remove wrong comments, add news/whatsnew entries
1 parent 1b6bef8 commit 6bd56d7

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,12 @@ Build changes
13101310
* GNU Autoconf 2.72 is now required to generate :file:`configure`.
13111311
(Contributed by Erlend Aasland in :gh:`115765`.)
13121312

1313+
* zlib is now officially required to build CPython.
1314+
It is still technically possible to build CPython without it for special needs, like bootstrapping.
1315+
Such builds are not supported, but we can accept pull requests to keep them working.
1316+
As an exception, zlib is not required on WASI.
1317+
(Contributed by Stan Ulbrych in :gh:`xxxxxx`.)
1318+
13131319
.. _whatsnew314-pep761:
13141320

13151321
PEP 761: Discontinuation of PGP signatures

Lib/encodings/zlib_codec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
import codecs
9-
import zlib # this codec needs the optional zlib module !
9+
import zlib
1010

1111
### Codec APIs
1212

Lib/test/test_zlib.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
import sys
99
from test.support import bigmemtest, _1G, _4G, is_s390x
1010

11+
# Building CPython without zlib is not supported except WASI.
12+
#
13+
# Anyone who wants build CPython this way should be prepared to patch it,
14+
# but the core team may help getting those patches to the main branch
15+
# (as that’s the place where multiple third parties can cooperate).
16+
#
17+
# For tests to pass without zlib, this file needs to be removed.
1118

12-
zlib = import_helper.import_module('zlib')
19+
zlib = import_helper.import_module('zlib', required_on=('linux', 'android', 'ios', 'darwin', 'win32', 'cygwin'))
1320

1421
requires_Compress_copy = unittest.skipUnless(
1522
hasattr(zlib.compressobj(), "copy"),
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Make zlib required to build CPython with the exception of WASI.
2+
(Contributed by Stan Ulbrych in :gh:`xxxxxx`.)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5323,7 +5323,7 @@ if test "$ac_cv_have_lchflags" = yes ; then
53235323
fi
53245324

53255325
dnl Check for compression libraries
5326-
AH_TEMPLATE([HAVE_ZLIB_COPY], [Define if the zlib library has inflateCopy])
5326+
AH_TEMPLATE([HAVE_ZLIB_COPY], [Define if the zlib library has inflateCopy; zlib 1.2.0 (2003) added inflateCopy.])
53275327

53285328
dnl detect zlib from Emscripten emport
53295329
PY_CHECK_EMSCRIPTEN_PORT([ZLIB], [-sUSE_ZLIB])

0 commit comments

Comments
 (0)