Skip to content

Commit dd3ecf5

Browse files
committed
downloads: cpython 3.10.9 -> 3.10.11, 3.11.1 -> 3.11.3
Due to upstream changes in 3.10 and 3.11, we had to patch the Windows build logic.
1 parent c0d1fbb commit dd3ecf5

File tree

2 files changed

+34
-20
lines changed

2 files changed

+34
-20
lines changed

cpython-windows/build.py

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -774,27 +774,31 @@ def hack_props(
774774
for line in fh:
775775
line = line.rstrip()
776776

777-
if b"<bz2Dir>" in line:
777+
# The syntax of these lines changed in 3.10+. 3.10 backport commit
778+
# 3139ea33ed84190e079d6ff4859baccdad778dae. Once we drop support for
779+
# Python 3.9 we can pass these via properties instead of editing the
780+
# properties file.
781+
if b"<bz2Dir" in line:
778782
line = b"<bz2Dir>%s\\</bz2Dir>" % bzip2_path
779783

780-
elif b"<libffiOutDir>" in line:
784+
elif b"<libffiOutDir" in line:
781785
line = b"<libffiOutDir>%s\\</libffiOutDir>" % libffi_path
782786

783-
elif b"<lzmaDir>" in line:
787+
elif b"<lzmaDir" in line:
784788
line = b"<lzmaDir>%s\\</lzmaDir>" % xz_path
785789

786-
elif b"<opensslIncludeDir>" in line:
790+
elif b"<opensslIncludeDir" in line:
787791
line = (
788792
b"<opensslIncludeDir>%s</opensslIncludeDir>" % openssl_include_path
789793
)
790794

791-
elif b"<opensslOutDir>" in line:
795+
elif b"<opensslOutDir" in line:
792796
line = b"<opensslOutDir>%s\\</opensslOutDir>" % openssl_libs_path
793797

794-
elif b"<sqlite3Dir>" in line:
798+
elif b"<sqlite3Dir" in line:
795799
line = b"<sqlite3Dir>%s\\</sqlite3Dir>" % sqlite_path
796800

797-
elif b"<zlibDir>" in line:
801+
elif b"<zlibDir" in line:
798802
line = b"<zlibDir>%s\\</zlibDir>" % zlib_path
799803

800804
lines.append(line)
@@ -804,11 +808,21 @@ def hack_props(
804808

805809
tcltkprops_path = pcbuild_path / "tcltk.props"
806810

807-
static_replace_in_file(
808-
tcltkprops_path,
809-
rb"<tcltkDir>$(ExternalsDir)tcltk-$(TclMajorVersion).$(TclMinorVersion).$(TclPatchLevel).$(TclRevision)\$(ArchName)\</tcltkDir>",
810-
rb"<tcltkDir>%s\$(ArchName)\</tcltkDir>" % tcltk_path,
811-
)
811+
# Later versions of 3.10 and 3.11 enabled support for defining paths via properties.
812+
# See CPython commit 3139ea33ed84190e079d6ff4859baccdad778dae.
813+
# Once we drop support for CPython 3.9 we can replace this with passing properties.
814+
try:
815+
static_replace_in_file(
816+
tcltkprops_path,
817+
rb"""<tcltkDir Condition="$(tcltkDir) == ''">$(ExternalsDir)tcltk-$(TclVersion)\$(ArchName)\</tcltkDir>""",
818+
rb"<tcltkDir>%s\$(ArchName)\</tcltkDir>" % tcltk_path,
819+
)
820+
except NoSearchStringError:
821+
static_replace_in_file(
822+
tcltkprops_path,
823+
rb"<tcltkDir>$(ExternalsDir)tcltk-$(TclMajorVersion).$(TclMinorVersion).$(TclPatchLevel).$(TclRevision)\$(ArchName)\</tcltkDir>",
824+
rb"<tcltkDir>%s\$(ArchName)\</tcltkDir>" % tcltk_path,
825+
)
812826

813827
# We want to statically link against OpenSSL. This requires using our own
814828
# OpenSSL build. This requires some hacking of various files.

pythonbuild/downloads.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@
5353
"python_tag": "cp39",
5454
},
5555
"cpython-3.10": {
56-
"url": "https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tar.xz",
57-
"size": 19612112,
58-
"sha256": "5ae03e308260164baba39921fdb4dbf8e6d03d8235a939d4582b33f0b5e46a83",
59-
"version": "3.10.9",
56+
"url": "https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tar.xz",
57+
"size": 19640792,
58+
"sha256": "3c3bc3048303721c904a03eb8326b631e921f11cc3be2988456a42f115daf04c",
59+
"version": "3.10.11",
6060
"licenses": ["Python-2.0", "CNRI-Python"],
6161
"license_file": "LICENSE.cpython.txt",
6262
"python_tag": "cp310",
6363
},
6464
"cpython-3.11": {
65-
"url": "https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz",
66-
"size": 19856648,
67-
"sha256": "85879192f2cffd56cb16c092905949ebf3e5e394b7f764723529637901dfb58f",
68-
"version": "3.11.1",
65+
"url": "https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tar.xz",
66+
"size": 19906156,
67+
"sha256": "8a5db99c961a7ecf27c75956189c9602c968751f11dbeae2b900dbff1c085b5e",
68+
"version": "3.11.3",
6969
"licenses": ["Python-2.0", "CNRI-Python"],
7070
"license_file": "LICENSE.cpython.txt",
7171
"python_tag": "cp311",

0 commit comments

Comments
 (0)