Skip to content

Commit ae72d66

Browse files
kpflemingzanieb
authored andcommitted
Support for Python 3.13.
1 parent 1dca4e6 commit ae72d66

17 files changed

+533
-12
lines changed

.github/workflows/apple.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ jobs:
109109
py: 'cpython-3.12'
110110
optimizations: 'pgo+lto'
111111

112+
- target_triple: 'aarch64-apple-darwin'
113+
runner: macos-14
114+
py: 'cpython-3.13'
115+
optimizations: 'debug'
116+
- target_triple: 'aarch64-apple-darwin'
117+
runner: macos-14
118+
py: 'cpython-3.13'
119+
optimizations: 'pgo'
120+
- target_triple: 'aarch64-apple-darwin'
121+
runner: macos-14
122+
py: 'cpython-3.13'
123+
optimizations: 'pgo+lto'
124+
112125
# macOS on Intel hardware. This is pretty straightforward. We exclude
113126
# noopt because it doesn't provide any compelling advantages over PGO
114127
# or LTO builds.
@@ -176,6 +189,19 @@ jobs:
176189
runner: macos-13
177190
py: 'cpython-3.12'
178191
optimizations: 'pgo+lto'
192+
193+
- target_triple: 'x86_64-apple-darwin'
194+
runner: macos-13
195+
py: 'cpython-3.13'
196+
optimizations: 'debug'
197+
- target_triple: 'x86_64-apple-darwin'
198+
runner: macos-13
199+
py: 'cpython-3.13'
200+
optimizations: 'pgo'
201+
- target_triple: 'x86_64-apple-darwin'
202+
runner: macos-13
203+
py: 'cpython-3.13'
204+
optimizations: 'pgo+lto'
179205
needs:
180206
- pythonbuild
181207
runs-on: ${{ matrix.build.runner }}

.github/workflows/linux.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ jobs:
170170
py: 'cpython-3.12'
171171
optimizations: 'lto'
172172

173+
- target_triple: 'aarch64-unknown-linux-gnu'
174+
py: 'cpython-3.13'
175+
optimizations: 'debug'
176+
- target_triple: 'aarch64-unknown-linux-gnu'
177+
py: 'cpython-3.13'
178+
optimizations: 'noopt'
179+
- target_triple: 'aarch64-unknown-linux-gnu'
180+
py: 'cpython-3.13'
181+
optimizations: 'lto'
182+
173183
# Cross-compiles can't do PGO and require Python 3.9.
174184
- target_triple: 'armv7-unknown-linux-gnueabi'
175185
py: 'cpython-3.9'
@@ -211,6 +221,16 @@ jobs:
211221
py: 'cpython-3.12'
212222
optimizations: 'lto'
213223

224+
- target_triple: 'armv7-unknown-linux-gnueabi'
225+
py: 'cpython-3.13'
226+
optimizations: 'debug'
227+
- target_triple: 'armv7-unknown-linux-gnueabi'
228+
py: 'cpython-3.13'
229+
optimizations: 'noopt'
230+
- target_triple: 'armv7-unknown-linux-gnueabi'
231+
py: 'cpython-3.13'
232+
optimizations: 'lto'
233+
214234
# Cross-compiles can't do PGO and require Python 3.9.
215235
- target_triple: 'armv7-unknown-linux-gnueabihf'
216236
py: 'cpython-3.9'
@@ -252,6 +272,16 @@ jobs:
252272
py: 'cpython-3.12'
253273
optimizations: 'lto'
254274

275+
- target_triple: 'armv7-unknown-linux-gnueabihf'
276+
py: 'cpython-3.13'
277+
optimizations: 'debug'
278+
- target_triple: 'armv7-unknown-linux-gnueabihf'
279+
py: 'cpython-3.13'
280+
optimizations: 'noopt'
281+
- target_triple: 'armv7-unknown-linux-gnueabihf'
282+
py: 'cpython-3.13'
283+
optimizations: 'lto'
284+
255285
# Cross-compiles can't do PGO and require Python 3.9.
256286
- target_triple: 'mips-unknown-linux-gnu'
257287
py: 'cpython-3.9'
@@ -293,6 +323,16 @@ jobs:
293323
py: 'cpython-3.12'
294324
optimizations: 'lto'
295325

326+
- target_triple: 'mips-unknown-linux-gnu'
327+
py: 'cpython-3.13'
328+
optimizations: 'debug'
329+
- target_triple: 'mips-unknown-linux-gnu'
330+
py: 'cpython-3.13'
331+
optimizations: 'noopt'
332+
- target_triple: 'mips-unknown-linux-gnu'
333+
py: 'cpython-3.13'
334+
optimizations: 'lto'
335+
296336
# Cross-compiles can't do PGO and require Python 3.9.
297337
- target_triple: 'mipsel-unknown-linux-gnu'
298338
py: 'cpython-3.9'
@@ -334,6 +374,16 @@ jobs:
334374
py: 'cpython-3.12'
335375
optimizations: 'lto'
336376

377+
- target_triple: 'mipsel-unknown-linux-gnu'
378+
py: 'cpython-3.13'
379+
optimizations: 'debug'
380+
- target_triple: 'mipsel-unknown-linux-gnu'
381+
py: 'cpython-3.13'
382+
optimizations: 'noopt'
383+
- target_triple: 'mipsel-unknown-linux-gnu'
384+
py: 'cpython-3.13'
385+
optimizations: 'lto'
386+
337387
# Cross-compiles can't do PGO and require Python 3.9.
338388
- target_triple: 's390x-unknown-linux-gnu'
339389
py: 'cpython-3.9'
@@ -375,6 +425,16 @@ jobs:
375425
py: 'cpython-3.12'
376426
optimizations: 'lto'
377427

428+
- target_triple: 's390x-unknown-linux-gnu'
429+
py: 'cpython-3.13'
430+
optimizations: 'debug'
431+
- target_triple: 's390x-unknown-linux-gnu'
432+
py: 'cpython-3.13'
433+
optimizations: 'noopt'
434+
- target_triple: 's390x-unknown-linux-gnu'
435+
py: 'cpython-3.13'
436+
optimizations: 'lto'
437+
378438
# Cross-compiles can't do PGO and require Python 3.9.
379439
- target_triple: 'ppc64le-unknown-linux-gnu'
380440
py: 'cpython-3.9'
@@ -416,6 +476,16 @@ jobs:
416476
py: 'cpython-3.12'
417477
optimizations: 'lto'
418478

479+
- target_triple: 'ppc64le-unknown-linux-gnu'
480+
py: 'cpython-3.13'
481+
optimizations: 'debug'
482+
- target_triple: 'ppc64le-unknown-linux-gnu'
483+
py: 'cpython-3.13'
484+
optimizations: 'noopt'
485+
- target_triple: 'ppc64le-unknown-linux-gnu'
486+
py: 'cpython-3.13'
487+
optimizations: 'lto'
488+
419489
# We don't publish noopt builds when PGO is available.
420490
- target_triple: 'x86_64-unknown-linux-gnu'
421491
py: 'cpython-3.8'
@@ -482,6 +552,19 @@ jobs:
482552
optimizations: 'pgo+lto'
483553
run: true
484554

555+
- target_triple: 'x86_64-unknown-linux-gnu'
556+
py: 'cpython-3.13'
557+
optimizations: 'debug'
558+
run: true
559+
- target_triple: 'x86_64-unknown-linux-gnu'
560+
py: 'cpython-3.13'
561+
optimizations: 'pgo'
562+
run: true
563+
- target_triple: 'x86_64-unknown-linux-gnu'
564+
py: 'cpython-3.13'
565+
optimizations: 'pgo+lto'
566+
run: true
567+
485568
- target_triple: 'x86_64_v2-unknown-linux-gnu'
486569
py: 'cpython-3.9'
487570
optimizations: 'debug'
@@ -534,6 +617,19 @@ jobs:
534617
optimizations: 'pgo+lto'
535618
run: true
536619

620+
- target_triple: 'x86_64_v2-unknown-linux-gnu'
621+
py: 'cpython-3.13'
622+
optimizations: 'debug'
623+
run: true
624+
- target_triple: 'x86_64_v2-unknown-linux-gnu'
625+
py: 'cpython-3.13'
626+
optimizations: 'pgo'
627+
run: true
628+
- target_triple: 'x86_64_v2-unknown-linux-gnu'
629+
py: 'cpython-3.13'
630+
optimizations: 'pgo+lto'
631+
run: true
632+
537633
- target_triple: 'x86_64_v3-unknown-linux-gnu'
538634
py: 'cpython-3.9'
539635
optimizations: 'debug'
@@ -586,6 +682,19 @@ jobs:
586682
optimizations: 'pgo+lto'
587683
run: true
588684

685+
- target_triple: 'x86_64_v3-unknown-linux-gnu'
686+
py: 'cpython-3.13'
687+
optimizations: 'debug'
688+
run: true
689+
- target_triple: 'x86_64_v3-unknown-linux-gnu'
690+
py: 'cpython-3.13'
691+
optimizations: 'pgo'
692+
run: true
693+
- target_triple: 'x86_64_v3-unknown-linux-gnu'
694+
py: 'cpython-3.13'
695+
optimizations: 'pgo+lto'
696+
run: true
697+
589698
# GitHub Actions runners don't support x86-64-v4 so we can't PGO.
590699
- target_triple: 'x86_64_v4-unknown-linux-gnu'
591700
py: 'cpython-3.9'
@@ -628,6 +737,16 @@ jobs:
628737
py: 'cpython-3.12'
629738
optimizations: 'lto'
630739

740+
- target_triple: 'x86_64_v4-unknown-linux-gnu'
741+
py: 'cpython-3.13'
742+
optimizations: 'debug'
743+
- target_triple: 'x86_64_v4-unknown-linux-gnu'
744+
py: 'cpython-3.13'
745+
optimizations: 'noopt'
746+
- target_triple: 'x86_64_v4-unknown-linux-gnu'
747+
py: 'cpython-3.13'
748+
optimizations: 'lto'
749+
631750
# musl doesn't support PGO.
632751
- target_triple: 'x86_64-unknown-linux-musl'
633752
py: 'cpython-3.8'
@@ -694,6 +813,19 @@ jobs:
694813
optimizations: 'lto'
695814
run: true
696815

816+
- target_triple: 'x86_64-unknown-linux-musl'
817+
py: 'cpython-3.13'
818+
optimizations: 'debug'
819+
run: true
820+
- target_triple: 'x86_64-unknown-linux-musl'
821+
py: 'cpython-3.13'
822+
optimizations: 'noopt'
823+
run: true
824+
- target_triple: 'x86_64-unknown-linux-musl'
825+
py: 'cpython-3.13'
826+
optimizations: 'lto'
827+
run: true
828+
697829
- target_triple: 'x86_64_v2-unknown-linux-musl'
698830
py: 'cpython-3.9'
699831
optimizations: 'debug'
@@ -746,6 +878,19 @@ jobs:
746878
optimizations: 'lto'
747879
run: true
748880

881+
- target_triple: 'x86_64_v2-unknown-linux-musl'
882+
py: 'cpython-3.13'
883+
optimizations: 'debug'
884+
run: true
885+
- target_triple: 'x86_64_v2-unknown-linux-musl'
886+
py: 'cpython-3.13'
887+
optimizations: 'noopt'
888+
run: true
889+
- target_triple: 'x86_64_v2-unknown-linux-musl'
890+
py: 'cpython-3.13'
891+
optimizations: 'lto'
892+
run: true
893+
749894
- target_triple: 'x86_64_v3-unknown-linux-musl'
750895
py: 'cpython-3.9'
751896
optimizations: 'debug'
@@ -798,6 +943,19 @@ jobs:
798943
optimizations: 'lto'
799944
run: true
800945

946+
- target_triple: 'x86_64_v3-unknown-linux-musl'
947+
py: 'cpython-3.13'
948+
optimizations: 'debug'
949+
run: true
950+
- target_triple: 'x86_64_v3-unknown-linux-musl'
951+
py: 'cpython-3.13'
952+
optimizations: 'noopt'
953+
run: true
954+
- target_triple: 'x86_64_v3-unknown-linux-musl'
955+
py: 'cpython-3.13'
956+
optimizations: 'lto'
957+
run: true
958+
801959
- target_triple: 'x86_64_v4-unknown-linux-musl'
802960
py: 'cpython-3.9'
803961
optimizations: 'debug'
@@ -838,6 +996,16 @@ jobs:
838996
py: 'cpython-3.12'
839997
optimizations: 'lto'
840998

999+
- target_triple: 'x86_64_v4-unknown-linux-musl'
1000+
py: 'cpython-3.13'
1001+
optimizations: 'debug'
1002+
- target_triple: 'x86_64_v4-unknown-linux-musl'
1003+
py: 'cpython-3.13'
1004+
optimizations: 'noopt'
1005+
- target_triple: 'x86_64_v4-unknown-linux-musl'
1006+
py: 'cpython-3.13'
1007+
optimizations: 'lto'
1008+
8411009
needs:
8421010
- pythonbuild
8431011
- image

.github/workflows/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- 'cpython-3.10'
5050
- 'cpython-3.11'
5151
- 'cpython-3.12'
52+
- 'cpython-3.13'
5253
vcvars:
5354
- 'vcvars32.bat'
5455
- 'vcvars64.bat'

cpython-unix/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ $(OUTDIR)/cpython-3.11-$(CPYTHON_3.11_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HO
270270
$(OUTDIR)/cpython-3.12-$(CPYTHON_3.12_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS)
271271
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.12-host
272272

273+
$(OUTDIR)/cpython-3.13-$(CPYTHON_3.13_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS)
274+
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.13-host
273275

274276
PYTHON_DEPENDS := \
275277
$(PYTHON_SUPPORT_FILES) \
@@ -318,3 +320,6 @@ $(OUTDIR)/cpython-$(CPYTHON_3.11_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DE
318320

319321
$(OUTDIR)/cpython-$(CPYTHON_3.12_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS)
320322
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.12
323+
324+
$(OUTDIR)/cpython-$(CPYTHON_3.13_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS)
325+
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.13

cpython-unix/build-cpython-host.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ pushd "Python-${PYTHON_VERSION}"
3838
# configure. This is reported as https://bugs.python.org/issue45405. We nerf the
3939
# check since we know what we're doing.
4040
if [ "${CC}" = "clang" ]; then
41-
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
41+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
42+
patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch
43+
elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
4244
patch -p1 -i ${ROOT}/patch-disable-multiarch.patch
4345
else
4446
patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch

0 commit comments

Comments
 (0)