python3: fix stdenv bootstrap on x86_64-darwin

The bootstrap tools linker sometimes crashes when trying to link the
sqlite3 tests, which causes the bootstrap Python not to have the sqlite3
module. This causes the freezegun module to fail to build later in the
bootstrap. Using the 11.0 SDK fixes the problem.

Upstream Python supports building with a newer SDK and back-deploying,
so this change should not negatively affect users on pre-11.0 releases.
This commit is contained in:
Randy Eckenrode 2024-10-03 07:47:30 -04:00
parent 3e5316cb96
commit 092b50a92c
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9
2 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,7 @@
# platform-specific dependencies
, bash
, apple-sdk_11
, darwin
, windows
@ -177,6 +178,9 @@ let
bluez
] ++ optionals enableFramework [
darwin.apple_sdk.frameworks.Cocoa
] ++ optionals stdenv.hostPlatform.isDarwin [
# Work around for ld64 crashes on x86_64-darwin. Remove once 11.0 becomes the default.
apple-sdk_11
] ++ optionals stdenv.hostPlatform.isMinGW [
windows.dlfcn
windows.mingw_w64_pthreads

View File

@ -648,6 +648,8 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
self = self.python3-bootstrap;
pythonAttr = "python3-bootstrap";
enableLTO = false;
# Workaround for ld64 crashes on x86_64-darwin. Remove after 11.0 is made the default.
inherit (prevStage) apple-sdk_11;
};
scons = super.scons.override { python3Packages = self.python3.pkgs; };