Skip to content

Commit a870b62

Browse files
authored
Add support for Python 3.14 on musl (#568)
Closes #558 Follow-up to #443
1 parent 7311355 commit a870b62

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

ci-targets.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,21 @@ linux:
256256
- "3.11"
257257
- "3.12"
258258
- "3.13"
259+
- "3.14"
259260
build_options:
260261
- debug+static
261262
- noopt+static
262263
- lto+static
263264
- debug
264265
- noopt
265266
- lto
267+
# freethreaded builds require mimalloc which is not available on musl yet
268+
# build_options_conditional:
269+
# - options:
270+
# - freethreaded+debug
271+
# - freethreaded+noopt
272+
# - freethreaded+lto
273+
# minimum-python-version: "3.13"
266274
run: true
267275

268276
x86_64_v2-unknown-linux-musl:
@@ -275,13 +283,21 @@ linux:
275283
- "3.11"
276284
- "3.12"
277285
- "3.13"
286+
- "3.14"
278287
build_options:
279288
- debug+static
280289
- noopt+static
281290
- lto+static
282291
- debug
283292
- noopt
284293
- lto
294+
# freethreaded builds require mimalloc which is not available on musl yet
295+
# build_options_conditional:
296+
# - options:
297+
# - freethreaded+debug
298+
# - freethreaded+noopt
299+
# - freethreaded+lto
300+
# minimum-python-version: "3.13"
285301
run: true
286302

287303
x86_64_v3-unknown-linux-musl:
@@ -294,13 +310,21 @@ linux:
294310
- "3.11"
295311
- "3.12"
296312
- "3.13"
313+
- "3.14"
297314
build_options:
298315
- debug+static
299316
- noopt+static
300317
- lto+static
301318
- debug
302319
- noopt
303320
- lto
321+
# freethreaded builds require mimalloc which is not available on musl yet
322+
# build_options_conditional:
323+
# - options:
324+
# - freethreaded+debug
325+
# - freethreaded+noopt
326+
# - freethreaded+lto
327+
# minimum-python-version: "3.13"
304328
run: true
305329

306330
x86_64_v4-unknown-linux-musl:
@@ -313,13 +337,21 @@ linux:
313337
- "3.11"
314338
- "3.12"
315339
- "3.13"
340+
- "3.14"
316341
build_options:
317342
- debug+static
318343
- noopt+static
319344
- lto+static
320345
- debug
321346
- noopt
322347
- lto
348+
# freethreaded builds require mimalloc which is not available on musl yet
349+
# build_options_conditional:
350+
# - options:
351+
# - freethreaded+debug
352+
# - freethreaded+noopt
353+
# - freethreaded+lto
354+
# minimum-python-version: "3.13"
323355
run: true
324356

325357
windows:

cpython-unix/build-cpython.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ if [ "${CC}" = "musl-clang" ]; then
391391
# provided by musl. These are part of the include files that are part of clang.
392392
# But musl-clang eliminates them from the default include path. So copy them into
393393
# place.
394-
for h in /tools/${TOOLCHAIN}/lib/clang/*/include/*intrin.h /tools/${TOOLCHAIN}/lib/clang/*/include/{__wmmintrin_aes.h,__wmmintrin_pclmul.h,mm_malloc.h}; do
394+
for h in /tools/${TOOLCHAIN}/lib/clang/*/include/*intrin.h /tools/${TOOLCHAIN}/lib/clang/*/include/{__wmmintrin_aes.h,__wmmintrin_pclmul.h,mm_malloc.h,cpuid.h}; do
395395
filename=$(basename "$h")
396396
if [ -e "/tools/host/include/${filename}" ]; then
397397
echo "${filename} already exists; don't need to copy!"
@@ -416,7 +416,7 @@ if [ -n "${CPYTHON_DEBUG}" ]; then
416416
fi
417417

418418
# Explicitly enable mimalloc on 3.13+, it's already included by default but with this it'll fail
419-
# if it's missing from the system. The MUSL builds do not supprt mimalloc yet.
419+
# if it's missing from the system. The musl builds do not supprt mimalloc yet.
420420
if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" && "${CC}" != "musl-clang" ]]; then
421421
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-mimalloc"
422422
fi
@@ -974,7 +974,7 @@ s390x-unknown-linux-gnu)
974974
x86_64-unknown-linux-*)
975975
# In Python 3.13+, the musl target is identified in cross compiles and the output directory
976976
# is named accordingly.
977-
if [ "${CC}" = "musl-clang" ] && [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
977+
if [[ "${CC}" = "musl-clang" && -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]]; then
978978
PYTHON_ARCH="x86_64-linux-musl"
979979
else
980980
PYTHON_ARCH="x86_64-linux-gnu"

0 commit comments

Comments
 (0)