From d01048948a23c4c3ab2ac6363cfaae8e01f4e041 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 14 Oct 2025 17:45:54 -0500 Subject: [PATCH 1/2] Revert ignore of JSON test on 3.15 --- cpython-unix/build-cpython.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 32992ee5..67b900d1 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -622,12 +622,6 @@ if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" && -n "${CROSS_COMPILING}" && "$ PROFILE_TASK="${PROFILE_TASK} --ignore test_strftime_y2k" fi -# On 3.15+ `test_json.test_recursion.TestCRecursion.test_highly_nested_objects_decoding` fails during -# PGO due to RecursionError not being raised as expected. See https://github.com/python/cpython/issues/140125 -if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]]; then - PROFILE_TASK="${PROFILE_TASK} --ignore test_json" -fi - # ./configure tries to auto-detect whether it can build 128-bit and 256-bit SIMD helpers for HACL, # but on x86-64 that requires v2 and v3 respectively, and on arm64 the performance is bad as noted # in the comments, so just don't even try. (We should check if we can make this conditional) From 212b6a3745cbbf87cc16897e1b1c85495955eeb5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 14 Oct 2025 20:54:19 -0500 Subject: [PATCH 2/2] Revert https://github.com/python/cpython/pull/139232 for testing --- cpython-unix/build-cpython.sh | 5 +++++ .../patch-revert-stack-limits-3.15.patch | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 cpython-unix/patch-revert-stack-limits-3.15.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 67b900d1..fd2469c5 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -522,6 +522,11 @@ if [ -n "${CPYTHON_OPTIMIZED}" ]; then fi fi +# Revert problematic C stack limits refactoring on 3.15 (macOS build issue) +if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" && "${PYBUILD_PLATFORM}" = macos* ]]; then + patch -p1 -i "${ROOT}/patch-revert-stack-limits-3.15.patch" +fi + if [ -n "${CPYTHON_LTO}" ]; then CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto" fi diff --git a/cpython-unix/patch-revert-stack-limits-3.15.patch b/cpython-unix/patch-revert-stack-limits-3.15.patch new file mode 100644 index 00000000..5d5047e8 --- /dev/null +++ b/cpython-unix/patch-revert-stack-limits-3.15.patch @@ -0,0 +1,17 @@ +diff --git a/Python/ceval.c b/Python/ceval.c +index f48f412fab8..3bf1c098003 100644 +--- a/Python/ceval.c ++++ b/Python/ceval.c +@@ -448,12 +448,6 @@ hardware_stack_limits(uintptr_t *top, uintptr_t *base) + ULONG guarantee = 0; + SetThreadStackGuarantee(&guarantee); + *base = (uintptr_t)low + guarantee; +-#elif defined(__APPLE__) +- pthread_t this_thread = pthread_self(); +- void *stack_addr = pthread_get_stackaddr_np(this_thread); // top of the stack +- size_t stack_size = pthread_get_stacksize_np(this_thread); +- *top = (uintptr_t)stack_addr; +- *base = ((uintptr_t)stack_addr) - stack_size; + #else + /// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size + /// (on alpine at least) is much smaller than expected and imposes undue limits