Skip to content

Commit c8abcae

Browse files
committed
Support for Python 3.13.
1 parent 9aa61da commit c8abcae

17 files changed

+533
-12
lines changed

.github/workflows/apple.yml

+26
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ jobs:
108108
py: 'cpython-3.12'
109109
optimizations: 'pgo+lto'
110110

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

.github/workflows/linux.yml

+168
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ jobs:
169169
py: 'cpython-3.12'
170170
optimizations: 'lto'
171171

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.github/workflows/windows.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
- 'cpython-3.10'
4949
- 'cpython-3.11'
5050
- 'cpython-3.12'
51+
- 'cpython-3.13'
5152
vcvars:
5253
- 'vcvars32.bat'
5354
- 'vcvars64.bat'

cpython-unix/Makefile

+5
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

+3-1
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)