diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 67bafc48..671ce34c 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -364,8 +364,14 @@ if [ -n "${CPYTHON_DEBUG}" ]; then CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-pydebug" fi +# Explicitly enable mimalloc on 3.13+, it's already included by default but with this it'll fail +# if it's missing from the system. The MUSL builds do not supprt mimalloc yet. +if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" && "${CC}" != "musl-clang" ]]; then + CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-mimalloc" +fi + if [ -n "${CPYTHON_FREETHREADED}" ]; then - CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --disable-gil --with-mimalloc" + CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --disable-gil" fi if [ -n "${CPYTHON_OPTIMIZED}" ]; then