From 024f70f64d19fd3775ce97d39809a118943d5fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Sun, 1 Jun 2025 10:10:49 +0200 Subject: [PATCH] swift: use Python 3.12 https://hydra.nixos.org/build/299109156 Per the release notes: https://docs.python.org/3/whatsnew/3.13.html > Remove the PyEval_ThreadsInitialized() function, deprecated in Python 3.9. Since Python 3.7, Py_Initialize() always creates the GIL: calling PyEval_InitThreads() does nothing and PyEval_ThreadsInitialized() always returns non-zero. --- pkgs/development/compilers/swift/compiler/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index fb7e4964eb86..c23b8e0877f5 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -11,7 +11,7 @@ pkg-config, clang, bintools, - python3Packages, + python312Packages, git, fetchpatch, fetchpatch2, @@ -48,7 +48,8 @@ let else targetPlatform.darwinMinVersion; - python3 = python3Packages.python.withPackages (p: [ p.setuptools ]); # python 3.12 compat. + # Use Python 3.12 for now because Swift 5.8 depends on Python's PyEval_ThreadsInitialized(), which was removed in 3.13. + python3 = python312Packages.python.withPackages (p: [ p.setuptools ]); # python 3.12 compat. inherit (stdenv) hostPlatform targetPlatform;