Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]; then
patch -p1 -i "${ROOT}/patch-testinternalcapi-interpreter-extern.patch"
fi

# Apply https://github.com/python/cpython/pull/149516 for a 3.15.0b1
# site startup regression.
if [ "${PYTHON_MAJMIN_VERSION}" = "3.15" ]; then
patch -p1 -i "${ROOT}/patch-site-reentrant-startup-files-3.15.patch"
fi

# Most bits look at CFLAGS. But setup.py only looks at CPPFLAGS.
# So we need to set both.
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC -I${TOOLS_PATH}/deps/include -I${TOOLS_PATH}/deps/include/ncursesw"
Expand Down
158 changes: 0 additions & 158 deletions cpython-unix/patch-site-reentrant-startup-files-3.15.patch

This file was deleted.

58 changes: 16 additions & 42 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,30 +311,6 @@ def static_replace_in_file(p: pathlib.Path, search, replace):
fh.write(data)


def apply_source_patch(cpython_source_path: pathlib.Path, patch_path: pathlib.Path):
with patch_path.open("rb") as fh:
patch = fh.read().replace(b"\r\n", b"\n")

with tempfile.NamedTemporaryFile("wb", delete=False) as fh:
fh.write(patch)
normalized_patch = pathlib.Path(fh.name)

try:
subprocess.run(
[
"git.exe",
"-C",
str(cpython_source_path),
"apply",
"--whitespace=nowarn",
str(normalized_patch),
],
check=True,
)
finally:
normalized_patch.unlink()


OPENSSL_PROPS_REMOVE_RULES_LEGACY = b"""
<ItemGroup>
<_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
Expand Down Expand Up @@ -396,8 +372,10 @@ def hack_props(

mpdecimal_version = DOWNLOADS["mpdecimal"]["version"]

if meets_python_minimum_version(python_version, "3.14") or arch == "arm64":
tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"]
if meets_python_minimum_version(python_version, "3.15"):
tcltk_commit = DOWNLOADS["tk-windows-bin-903"]["git_commit"]
elif meets_python_minimum_version(python_version, "3.14") or arch == "arm64":
tcltk_commit = DOWNLOADS["tk-windows-bin-8614"]["git_commit"]
else:
tcltk_commit = DOWNLOADS["tk-windows-bin-8612"]["git_commit"]

Expand Down Expand Up @@ -1395,15 +1373,17 @@ def build_cpython(
setuptools_wheel = download_entry("setuptools", BUILD)
pip_wheel = download_entry("pip", BUILD)

# On CPython 3.14+, we use the latest tcl/tk version which has additional
# runtime dependencies, so we are conservative and use the old version
# elsewhere. The old version isn't built for arm64, so we use the new
# version there too
tk_bin_entry = (
"tk-windows-bin"
if meets_python_minimum_version(python_version, "3.14") or arch == "arm64"
else "tk-windows-bin-8612"
)
# We use a prebuild tcl/tk from the upstream CPython project.
# Tcl/tk 8.6.14+ has an additional runtime dependency. We are conservative and
# use an old version prior to CPython 3.14. The older tck/tk release
# is not available for arm64 so we use a newer release there as well.
# On CPython 3.14+ we match the version included in the Python.org release.
if meets_python_minimum_version(python_version, "3.15"):
tk_bin_entry = "tk-windows-bin-903"
elif meets_python_minimum_version(python_version, "3.14") or arch == "arm64":
tk_bin_entry = "tk-windows-bin-8614"
else:
tk_bin_entry = "tk-windows-bin-8612"
tk_bin_archive = download_entry(
tk_bin_entry, BUILD, local_name="tk-windows-bin.tar.gz"
)
Expand Down Expand Up @@ -1509,7 +1489,7 @@ def build_cpython(
shutil.copyfile(source, dest)

# Delete the tk nmake helper, it's not needed and links msvc
if tk_bin_entry == "tk-windows-bin":
if tk_bin_entry in ("tk-windows-bin-8614", "tk-windows-bin-903"):
tcltk_commit: str = DOWNLOADS[tk_bin_entry]["git_commit"]
tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit)
(
Expand All @@ -1523,12 +1503,6 @@ def build_cpython(
cpython_source_path = td / ("Python-%s" % python_version)
pcbuild_path = cpython_source_path / "PCbuild"

if python_version.startswith("3.15."):
apply_source_patch(
cpython_source_path,
SUPPORT / "patch-site-reentrant-startup-files-3.15.patch",
)

out_dir = td / "out"

build_dir = out_dir / "python" / "build"
Expand Down
Loading