Sitelet https://github.com/astral-sh/python-build-standalone/pull/1303/files
Skip to content
Draft
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
8 changes: 8 additions & 0 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" && "${TARGET_TRIPLE}" == x86_64*
PROFILE_TASK="${PROFILE_TASK} --ignore test.test_bytes.BytesTest.test_from_format"
fi

# LLVM 23's BOLT instrumentation exhausts the stack in these recursion tests.
if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" && -n "${BOLT_CAPABLE}" && "${LLVM_VERSION}" = 23 && "${TARGET_TRIPLE}" == x86_64* ]]; then
PROFILE_TASK="${PROFILE_TASK} --ignore test.test_json.test_recursion.TestCRecursion.test_endless_recursion"
PROFILE_TASK="${PROFILE_TASK} --ignore test.test_functools.TestLRUC.test_lru_recursion"
PROFILE_TASK="${PROFILE_TASK} --ignore test.test_functools.*.test_recursive_pickle"
PROFILE_TASK="${PROFILE_TASK} --ignore test.test_xml_etree_c.BadElementTest.test_deeply_nested_deepcopy"
fi

# We use ndbm on macOS and BerkeleyDB elsewhere.
if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-dbmliborder=ndbm"
Expand Down
7 changes: 7 additions & 0 deletions cpython-unix/build-tk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ LDFLAGS="${EXTRA_TARGET_LDFLAGS}"
if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then
CFLAGS="${CFLAGS} -I${TOOLS_PATH}/deps/include -Wno-availability"
CFLAGS="${CFLAGS} -Wno-deprecated-declarations -Wno-unknown-attributes -Wno-typedef-redefinition"
# Clang 23 emits Objective-C class selector stubs that ld64.lld cannot link.
# Probe the flag because older macOS toolchains do not recognize it.
# lld from LLVM 23 does not yet support theses stubs
# https://github.com/llvm/llvm-project/pull/219744
if "${CC}" -fno-objc-msgsend-class-selector-stubs -x objective-c -fsyntax-only /dev/null >/dev/null 2>&1; then
CFLAGS="${CFLAGS} -fno-objc-msgsend-class-selector-stubs"
fi
LDFLAGS="${LDFLAGS} -L${TOOLS_PATH}/deps/lib"
EXTRA_CONFIGURE_FLAGS="--enable-aqua=yes --without-x"
else
Expand Down
2 changes: 1 addition & 1 deletion cpython-unix/patch-jit-llvm-version-3.13.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index b68da1b6be1..cf04f83539e 100644
import typing

-_LLVM_VERSION = 18
+_LLVM_VERSION = 22
+_LLVM_VERSION = int(os.environ.get("LLVM_VERSION", "18"))
_LLVM_VERSION_PATTERN = re.compile(
rf"(?<!Apple )(LLVM|clang) version\s+{_LLVM_VERSION}\.\d+\.\d+\S*\s+"
)
2 changes: 1 addition & 1 deletion cpython-unix/patch-jit-llvm-version-3.14.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ diff --git a/Tools/jit/_llvm.py b/Tools/jit/_llvm.py
import _targets

-_LLVM_VERSION = 19
+_LLVM_VERSION = 22
+_LLVM_VERSION = int(os.environ.get("LLVM_VERSION", "19"))
_LLVM_VERSION_PATTERN = re.compile(
rf"(?<!Apple )(LLVM|clang) version\s+{_LLVM_VERSION}\.\d+\.\d+\S*\s+"
)
2 changes: 0 additions & 2 deletions cpython-unix/targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
aarch64-apple-darwin:
host_platforms:
- macos_arm64
- macos_x86_64
pythons_supported:
- '3.10'
- '3.11'
Expand Down Expand Up @@ -636,7 +635,6 @@ s390x-unknown-linux-gnu:
x86_64-apple-darwin:
host_platforms:
- macos_arm64
- macos_x86_64
pythons_supported:
- '3.10'
- '3.11'
Expand Down
30 changes: 12 additions & 18 deletions pythonbuild/downloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,22 @@
"version": "7.0.12-2~bpo13+1"
},
"llvm-aarch64-linux": {
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20260410/llvm-22.1.3+20260410-gnu_only-aarch64-unknown-linux-gnu.tar.zst",
"size": 237655768,
"sha256": "9cb4b562323a3d899fffe6393148e92447e17b69a2501d7c6e7f2a86c32cddc1",
"version": "22.1.3+20260410"
"url": "https://github.com/astral-sh/llvm-build/releases/download/20260925/llvm-23.1.2+20260925-gnu_only-aarch64-unknown-linux-gnu.tar.zst",
"size": 219511882,
"sha256": "fe4dc64a553ada62fdbd732234cc6db4bab60c8516f9ea520c4abea7b646c900",
"version": "23.1.2+20260925"
},
"llvm-x86_64-linux": {
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20260410/llvm-22.1.3+20260410-gnu_only-x86_64-unknown-linux-gnu.tar.zst",
"size": 281109065,
"sha256": "0ee8e4f89c20983d62547b1e665147ee08a7413f478e9e443fa991548da1030d",
"version": "22.1.3+20260410"
"url": "https://github.com/astral-sh/llvm-build/releases/download/20260925/llvm-23.1.2+20260925-gnu_only-x86_64-unknown-linux-gnu.tar.zst",
"size": 227890333,
"sha256": "96ea5dcf7663787984f44b3cff25259b0a8cf7cce615331102144cbdde833f9f",
"version": "23.1.2+20260925"
},
"llvm-aarch64-macos": {
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20260410/llvm-22.1.3+20260410-aarch64-apple-darwin.tar.zst",
"size": 159775425,
"sha256": "98171836c31c04edec074e5f3fee67fcace4bf3859b68a770dd9ff2039ea127d",
"version": "22.1.3+20260410"
},
"llvm-x86_64-macos": {
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20260410/llvm-22.1.3+20260410-x86_64-apple-darwin.tar.zst",
"size": 167376011,
"sha256": "15bfda1bc8bc920658c09ef1ebb4593f0705b3314beab23989f14775f2e3f3f0",
"version": "22.1.3+20260410"
"url": "https://github.com/astral-sh/llvm-build/releases/download/20260925/llvm-23.1.2+20260925-aarch64-apple-darwin.tar.zst",
"size": 165484624,
"sha256": "2adaeff353a29e60f92a16c9eae603dbbdc9613c04ad6c0fac9a5c4a40dd7eb0",
"version": "23.1.2+20260925"
},
"m4": {
"upstream_url": "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz",
Expand Down
8 changes: 3 additions & 5 deletions pythonbuild/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def current_host_platform() -> str:
if machine == "arm64":
return "macos_arm64"
elif machine == "x86_64":
return "macos_x86_64"
raise Exception(
"macOS builds require an Apple Silicon host running native arm64 Python"
)
else:
raise Exception(f"unhanded macOS machine type: {machine}")
elif sys.platform == "win32":
Expand Down Expand Up @@ -75,8 +77,6 @@ def default_target_triple() -> str:
return "aarch64-unknown-linux-gnu"
elif host == "macos_arm64":
return "aarch64-apple-darwin"
elif host == "macos_x86_64":
return "x86_64-apple-darwin"
elif host == "windows_x86":
return "i686-pc-windows-msvc"
elif host == "windows_x86_64":
Expand Down Expand Up @@ -506,8 +506,6 @@ def clang_toolchain(host_platform: str, target_triple: str) -> str:
return "llvm-aarch64-linux"
elif host_platform == "macos_arm64":
return "llvm-aarch64-macos"
elif host_platform == "macos_x86_64":
return "llvm-x86_64-macos"
else:
raise Exception("unhandled host platform")

Expand Down
1 change: 0 additions & 1 deletion scripts/update_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ def xorg_policy(category: str, name: str, extension: str = "tar.gz") -> Policy:
"llvm-aarch64-linux": "toolchain bootstrap requires coordinated updates",
"llvm-x86_64-linux": "toolchain bootstrap requires coordinated updates",
"llvm-aarch64-macos": "toolchain bootstrap requires coordinated updates",
"llvm-x86_64-macos": "toolchain bootstrap requires coordinated updates",
"musl": "intentionally pinned build toolchain",
"musl-static": "intentionally pinned build toolchain",
"openssl-1.1": "end-of-life release series",
Expand Down
Loading