From b95b6d641ef6f188fc0bcf8f114fa7f6805e491d Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 16 Sep 2025 19:58:22 +0300 Subject: [PATCH] python27: fix build with gcc15 - add " -std=gnu17" to `env.NIX_CFLAGS_COMPILE` Fixes build failure with gcc15: ``` In file included from Include/Python-ast.h:3, from Python/bltinmodule.c:4: Include/asdl.h:9:15: error: cannot use keyword 'false' as enumeration constant 9 | typedef enum {false, true} bool; | ^~~~~ Include/asdl.h:9:15: note: 'false' is a keyword with '-std=c23' onwards Include/asdl.h:9:28: error: expected ';', identifier or '(' before 'bool' 9 | typedef enum {false, true} bool; | ^~~~ Include/asdl.h:9:28: warning: useless type name in empty declaration In file included from Include/Python-ast.h:3, from Python/compile.c:26: Include/asdl.h:9:15: error: cannot use keyword 'false' as enumeration constant 9 | typedef enum {false, true} bool; | ^~~~~ Include/asdl.h:9:15: note: 'false' is a keyword with '-std=c23' onwards Include/asdl.h:9:28: error: expected ';', identifier or '(' before 'bool' 9 | typedef enum {false, true} bool; | ^~~~ ``` --- pkgs/development/interpreters/python/cpython/2.7/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 94ff0c97dfa8..2c2b3b597991 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -319,7 +319,8 @@ stdenv.mkDerivation ( env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.targetPlatform.system == "x86_64-darwin") "-msse2" - + lib.optionalString stdenv.hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000"; + + lib.optionalString stdenv.hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000" + + " -std=gnu17"; DETERMINISTIC_BUILD = 1; setupHook = python-setup-hook sitePackages;