From 8837f2fef288bf04e54f1d6fd6a777e6cae8c00b Mon Sep 17 00:00:00 2001 From: natsukium Date: Wed, 13 Mar 2024 23:32:38 +0900 Subject: [PATCH] python313: add a flag to disable GIL --- pkgs/development/interpreters/python/cpython/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index b983fa8f5461..4a0533536c84 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -60,6 +60,7 @@ , static ? stdenv.hostPlatform.isStatic , enableFramework ? false , noldconfigPatch ? ./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch" +, enableGIL ? true # pgo (not reproducible) + -fno-semantic-interposition # https://docs.python.org/3/using/configure.html#cmdoption-enable-optimizations @@ -111,6 +112,7 @@ let inherit (lib) concatMapStringsSep concatStringsSep + enableFeature getDev getLib optionals @@ -402,6 +404,8 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { "--enable-shared" ] ++ optionals enableFramework [ "--enable-framework=${placeholder "out"}/Library/Frameworks" + ] ++ optionals (pythonAtLeast "3.13") [ + (enableFeature enableGIL "gil") ] ++ optionals enableOptimizations [ "--enable-optimizations" ] ++ optionals (sqlite != null) [