@@ -346,16 +346,18 @@ def hack_props(
346
346
pcbuild_path : pathlib .Path ,
347
347
arch : str ,
348
348
python_version : str ,
349
+ zlib_entry : str
349
350
):
350
351
# TODO can we pass props into msbuild.exe?
351
352
352
353
# Our dependencies are in different directories from what CPython's
353
354
# build system expects. Modify the config file appropriately.
354
355
356
+
355
357
bzip2_version = DOWNLOADS ["bzip2" ]["version" ]
356
358
sqlite_version = DOWNLOADS ["sqlite" ]["version" ]
357
359
xz_version = DOWNLOADS ["xz" ]["version" ]
358
- zlib_version = DOWNLOADS ["zlib" ]["version" ]
360
+ zlib_version = DOWNLOADS [zlib_entry ]["version" ]
359
361
360
362
mpdecimal_version = DOWNLOADS ["mpdecimal" ]["version" ]
361
363
@@ -369,7 +371,7 @@ def hack_props(
369
371
libffi_path = td / "libffi"
370
372
tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit )
371
373
xz_path = td / ("xz-%s" % xz_version )
372
- zlib_path = td / ("zlib -%s" % zlib_version )
374
+ zlib_path = td / ("%s -%s" % ( zlib_entry , zlib_version ) )
373
375
mpdecimal_path = td / ("mpdecimal-%s" % mpdecimal_version )
374
376
375
377
openssl_root = td / "openssl" / arch
@@ -484,6 +486,7 @@ def hack_project_files(
484
486
cpython_source_path : pathlib .Path ,
485
487
build_directory : str ,
486
488
python_version : str ,
489
+ zlib_entry : str
487
490
):
488
491
"""Hacks Visual Studio project files to work with our build."""
489
492
@@ -494,6 +497,7 @@ def hack_project_files(
494
497
pcbuild_path ,
495
498
build_directory ,
496
499
python_version ,
500
+ zlib_entry ,
497
501
)
498
502
499
503
# Our SQLite directory is named weirdly. This throws off version detection
@@ -913,6 +917,7 @@ def collect_python_build_artifacts(
913
917
arch : str ,
914
918
config : str ,
915
919
openssl_entry : str ,
920
+ zlib_entry : str ,
916
921
freethreaded : bool ,
917
922
):
918
923
"""Collect build artifacts from Python.
@@ -1142,6 +1147,9 @@ def find_additional_dependencies(project: pathlib.Path):
1142
1147
if name == "openssl" :
1143
1148
name = openssl_entry
1144
1149
1150
+ if name = "zlib" :
1151
+ name = zlib_entry
1152
+
1145
1153
# On 3.14+, we use the latest tcl/tk version
1146
1154
if ext == "_tkinter" and python_majmin == "314" :
1147
1155
name = name .replace ("-8612" , "" )
@@ -1213,10 +1221,12 @@ def build_cpython(
1213
1221
# The python.props file keys off MSBUILD, so it needs to be set.
1214
1222
os .environ ["MSBUILD" ] = str (msbuild )
1215
1223
1224
+ zlib_entry = "zlib-ng" if meets_python_minimum_version ("3.14" ) else "zlib"
1225
+
1216
1226
bzip2_archive = download_entry ("bzip2" , BUILD )
1217
1227
sqlite_archive = download_entry ("sqlite" , BUILD )
1218
1228
xz_archive = download_entry ("xz" , BUILD )
1219
- zlib_archive = download_entry ("zlib" , BUILD )
1229
+ zlib_archive = download_entry (zlib_entry , BUILD )
1220
1230
1221
1231
python_archive = download_entry (python_entry_name , BUILD )
1222
1232
entry = DOWNLOADS [python_entry_name ]
@@ -1328,6 +1338,7 @@ def build_cpython(
1328
1338
cpython_source_path ,
1329
1339
build_directory ,
1330
1340
python_version = python_version ,
1341
+ zlib_entry = zlib_entry ,
1331
1342
)
1332
1343
1333
1344
if pgo :
@@ -1528,6 +1539,7 @@ def build_cpython(
1528
1539
build_directory ,
1529
1540
artifact_config ,
1530
1541
openssl_entry = openssl_entry ,
1542
+ zlib_entry = zlib_entry ,
1531
1543
freethreaded = freethreaded ,
1532
1544
)
1533
1545
0 commit comments