From 49a0059a59a950c9261325fad14a2f905f53036d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 1 Feb 2022 20:26:12 -0500 Subject: [PATCH 1/3] python3: unset MACOSX_DEPLOYMENT_TARGET Setting an old target conflicts with the -stack_size,1000000 linker flag. This fixes build of python310. This reverts ce59dec5 ('python34: as a workaround, explicitly set MACOSX_DEPLOYMENT_TARGET') --- pkgs/development/interpreters/python/cpython/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 7a2a79b8cfed..48484563e938 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -344,7 +344,6 @@ in with passthru; stdenv.mkDerivation { done '' + optionalString stdenv.isDarwin '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2" - export MACOSX_DEPLOYMENT_TARGET=10.6 # Override the auto-detection in setup.py, which assumes a universal build export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.isAarch64 then "uint128" else "x64"} '' + optionalString (isPy3k && pythonOlder "3.7") '' From c7c3187d9897b304c85542130ece7bacc44906a9 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 1 Feb 2022 20:29:33 -0500 Subject: [PATCH 2/3] python3: don't patch out -Wl,-stack_size,1000000 The original motivation behind removing that was to appease a consumer of python-config's output. That issue was probably resolved by now, so let's bring the build in sync with what python is doing by default. This reverts b7819e38 ('python3.x: Patch extra stack size on darwin') --- pkgs/development/interpreters/python/cpython/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 48484563e938..268f90f96166 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -192,7 +192,6 @@ in with passthru; stdenv.mkDerivation { prePatch = optionalString stdenv.isDarwin '' substituteInPlace configure --replace '`/usr/bin/arch`' '"i386"' - substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' '' + optionalString (pythonOlder "3.9" && stdenv.isDarwin && x11Support) '' # Broken on >= 3.9; replaced with ./3.9/darwin-tcl-tk.patch substituteInPlace setup.py --replace /Library/Frameworks /no-such-path From 68d828f64ca8cde5dbe85c55ca6563f92482cd4e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 2 Feb 2022 18:22:09 -0500 Subject: [PATCH 3/3] python3: don't hardcode -msse2 on darwin The -msse2 flag was hardcoded back when python32 was added in 47d86a83 ('Adding Python 3.2'). --- pkgs/development/interpreters/python/cpython/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 268f90f96166..5cb6d0a35f0d 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -342,7 +342,6 @@ in with passthru; stdenv.mkDerivation { substituteInPlace ./setup.py --replace $i /no-such-path done '' + optionalString stdenv.isDarwin '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2" # Override the auto-detection in setup.py, which assumes a universal build export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.isAarch64 then "uint128" else "x64"} '' + optionalString (isPy3k && pythonOlder "3.7") ''