diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index a8ff460f..ca9e166c 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -311,6 +311,15 @@ _heapq: sources: - _heapqmodule.c +_hmac: + minimum-python-version: '3.14' + sources: + - hmacmodule.c + includes: + - Modules/_hacl + links: + - :libHacl_Hash_Blake2.a + _imp: config-c-only: true @@ -700,6 +709,12 @@ _tracemalloc: required-targets: - .* +_types: + minimum-python-version: "3.14" + setup-enabled: true + sources: + - _typesmodule.c + _typing: minimum-python-version: "3.11" setup-enabled-conditional: diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 7e4d78ac..a9d82bef 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -346,6 +346,7 @@ def hack_props( pcbuild_path: pathlib.Path, arch: str, python_version: str, + zlib_entry: str, ): # TODO can we pass props into msbuild.exe? @@ -355,7 +356,7 @@ def hack_props( bzip2_version = DOWNLOADS["bzip2"]["version"] sqlite_version = DOWNLOADS["sqlite"]["version"] xz_version = DOWNLOADS["xz"]["version"] - zlib_version = DOWNLOADS["zlib"]["version"] + zlib_version = DOWNLOADS[zlib_entry]["version"] mpdecimal_version = DOWNLOADS["mpdecimal"]["version"] @@ -369,7 +370,7 @@ def hack_props( libffi_path = td / "libffi" tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit) xz_path = td / ("xz-%s" % xz_version) - zlib_path = td / ("zlib-%s" % zlib_version) + zlib_path = td / ("%s-%s" % (zlib_entry, zlib_version)) mpdecimal_path = td / ("mpdecimal-%s" % mpdecimal_version) openssl_root = td / "openssl" / arch @@ -484,6 +485,7 @@ def hack_project_files( cpython_source_path: pathlib.Path, build_directory: str, python_version: str, + zlib_entry: str, ): """Hacks Visual Studio project files to work with our build.""" @@ -494,6 +496,7 @@ def hack_project_files( pcbuild_path, build_directory, python_version, + zlib_entry, ) # Our SQLite directory is named weirdly. This throws off version detection @@ -913,6 +916,7 @@ def collect_python_build_artifacts( arch: str, config: str, openssl_entry: str, + zlib_entry: str, freethreaded: bool, ): """Collect build artifacts from Python. @@ -1142,6 +1146,9 @@ def find_additional_dependencies(project: pathlib.Path): if name == "openssl": name = openssl_entry + if name == "zlib": + name = zlib_entry + # On 3.14+, we use the latest tcl/tk version if ext == "_tkinter" and python_majmin == "314": name = name.replace("-8612", "") @@ -1213,16 +1220,19 @@ def build_cpython( # The python.props file keys off MSBUILD, so it needs to be set. os.environ["MSBUILD"] = str(msbuild) - bzip2_archive = download_entry("bzip2", BUILD) - sqlite_archive = download_entry("sqlite", BUILD) - xz_archive = download_entry("xz", BUILD) - zlib_archive = download_entry("zlib", BUILD) - python_archive = download_entry(python_entry_name, BUILD) entry = DOWNLOADS[python_entry_name] - python_version = entry["version"] + zlib_entry = ( + "zlib-ng" if meets_python_minimum_version(python_version, "3.14") else "zlib" + ) + + bzip2_archive = download_entry("bzip2", BUILD) + sqlite_archive = download_entry("sqlite", BUILD) + xz_archive = download_entry("xz", BUILD) + zlib_archive = download_entry(zlib_entry, BUILD) + setuptools_wheel = download_entry("setuptools", BUILD) pip_wheel = download_entry("pip", BUILD) @@ -1328,6 +1338,7 @@ def build_cpython( cpython_source_path, build_directory, python_version=python_version, + zlib_entry=zlib_entry, ) if pgo: @@ -1528,6 +1539,7 @@ def build_cpython( build_directory, artifact_config, openssl_entry=openssl_entry, + zlib_entry=zlib_entry, freethreaded=freethreaded, ) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 89f3ce08..8a5bb89f 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -82,10 +82,10 @@ "python_tag": "cp313", }, "cpython-3.14": { - "url": "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a6.tar.xz", - "size": 22956068, - "sha256": "8d6181e5331d9a2cd6ca405ae1230e88589a043f4768ebb443d3889d45c1c35c", - "version": "3.14.0a6", + "url": "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a7.tar.xz", + "size": 23015952, + "sha256": "71adbcec3ac9edf93308e55cfb4184f2eb4b16fda2bb0a5a382929ed29c8386d", + "version": "3.14.0a7", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp314", @@ -446,4 +446,13 @@ "licenses": ["Zlib"], "license_file": "LICENSE.zlib.txt", }, + "zlib-ng": { + "url": "https://github.com/python/cpython-source-deps/archive/refs/tags/zlib-ng-2.2.4.tar.gz", + "size": 2415819, + "sha256": "00bbd88709bc416cb96160ab61d3e1c8f76e106799af7328d0fe434dc7dd5004", + "version": "2.2.4", + "library_names": ["z"], + "licenses": ["Zlib"], + "license_file": "LICENSE.zlib-ng.txt", + }, }