From b92751652ea0565b8c6922131c5b81f63d297e10 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Tue, 16 Dec 2025 20:23:53 +0100 Subject: [PATCH] pypy: remove explicit darwin minimum SDK PyPy sets an explicit minimum SDK version for darwin that is much older than what we we default to on nixpkgs (currently 14.0). Simply removing the explicit flag makes it use our default instead. This fixes a build failure where PyPy tries to access APIs that are not available in the macOS SDK it is targetting. This is technically not relevant for upstream as this is an opt-in warning which we have recently enabled by default (as error) on nixpkgs, but they too should bump the minimum target to at least 10.15 from their current target of 10.13. --- .../python/pypy/darwin_version_min.patch | 19 +++++++++++++++++++ .../interpreters/python/pypy/default.nix | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/interpreters/python/pypy/darwin_version_min.patch diff --git a/pkgs/development/interpreters/python/pypy/darwin_version_min.patch b/pkgs/development/interpreters/python/pypy/darwin_version_min.patch new file mode 100644 index 000000000000..18b5726ce13d --- /dev/null +++ b/pkgs/development/interpreters/python/pypy/darwin_version_min.patch @@ -0,0 +1,19 @@ +diff --git a/rpython/translator/platform/darwin.py b/rpython/translator/platform/darwin.py +index 8c824a8459..f407fb6c07 100644 +--- a/rpython/translator/platform/darwin.py ++++ b/rpython/translator/platform/darwin.py +@@ -26,12 +26,12 @@ class Darwin(posix.BasePosix): + standalone_only = ('-mdynamic-no-pic',) + shared_only = () + +- link_flags = (DARWIN_VERSION_MIN,) ++ link_flags = () + cflags = ('-O3', + '-fomit-frame-pointer', + # The parser turns 'const char *const *includes' into 'const const char **includes' + '-Wno-duplicate-decl-specifier', +- DARWIN_VERSION_MIN,) ++ ) + + so_ext = 'dylib' + DEFAULT_CC = 'clang' diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index 727e76b7fd7a..bfe766fc2917 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -171,6 +171,11 @@ stdenv.mkDerivation rec { inherit (sqlite) out dev; libsqlite = "${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}"; }) + + # PyPy sets an explicit minimum SDK version for darwin that is much older + # than what we default to on nixpkgs. + # Simply removing the explicit flag makes it use our default instead. + ./darwin_version_min.patch ]; postPatch = ''