about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2020-01-12 21:29:45 +0100
committerDaiderd Jordan <daiderd@gmail.com>2020-01-13 11:34:36 +0100
commit6328518e98e8097d79e49efa692c4babb2f0eda8 (patch)
treead2f5e4d3398b906187cc4a2d1e88dd03c6c6111 /pkgs/stdenv
parent73db5d8c3873f47822c8d6294fde8163c322af12 (diff)
downloadnixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar.gz
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar.bz2
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar.lz
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar.xz
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.tar.zst
nixlib-6328518e98e8097d79e49efa692c4babb2f0eda8.zip
stdenv: bootstrap darwin with python3
- Replaced python override from the final stdenv, instead we
  propagate our bootstrap python to stage4 and override both
  CF and xnu to use it.

- Removed CF argument from python interpreters, this is redundant
  since it's not overidden anymore.

- Inherit CF from stage4, making it the same as the stdenv.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/darwin/default.nix33
1 files changed, 10 insertions, 23 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 86a6e33c9424..f73fca48b7a7 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -190,13 +190,10 @@ in rec {
         useSharedLibraries = false;
       };
 
-      python = super.callPackage ../../development/interpreters/python/cpython/2.7/boot.nix {
-        CF = null;  # use CoreFoundation from bootstrap-tools
-        configd = null;
-      };
-      python2 = self.python;
+      python3 = super.python3Minimal;
 
       ninja = super.ninja.override { buildDocs = false; };
+
       darwin = super.darwin // {
         cctools = super.darwin.cctools.override {
           enableTapiSupport = false;
@@ -218,11 +215,11 @@ in rec {
   stage2 = prevStage: let
     persistent = self: super: with prevStage; {
       inherit
-        zlib patchutils m4 scons flex perl bison unifdef unzip openssl python
+        zlib patchutils m4 scons flex perl bison unifdef unzip openssl python3
         libxml2 gettext sharutils gmp libarchive ncurses pkg-config libedit groff
         openssh sqlite sed serf openldap db cyrus-sasl expat apr-util subversion xz
         findfreetype libssh curl cmake autoconf automake libtool ed cpio coreutils
-        libssh2 nghttp2 libkrb5 python2 ninja;
+        libssh2 nghttp2 libkrb5 ninja;
 
       darwin = super.darwin // {
         inherit (darwin)
@@ -252,11 +249,11 @@ in rec {
   stage3 = prevStage: let
     persistent = self: super: with prevStage; {
       inherit
-        patchutils m4 scons flex perl bison unifdef unzip openssl python
+        patchutils m4 scons flex perl bison unifdef unzip openssl python3
         gettext sharutils libarchive pkg-config groff bash subversion
         openssh sqlite sed serf openldap db cyrus-sasl expat apr-util
         findfreetype libssh curl cmake autoconf automake libtool cpio
-        libssh2 nghttp2 libkrb5 python2 ninja;
+        libssh2 nghttp2 libkrb5 ninja;
 
       # Avoid pulling in a full python and its extra dependencies for the llvm/clang builds.
       libxml2 = super.libxml2.override { pythonSupport = false; };
@@ -302,7 +299,7 @@ in rec {
   stage4 = prevStage: let
     persistent = self: super: with prevStage; {
       inherit
-        gnumake gzip gnused bzip2 gawk ed xz patch bash
+        gnumake gzip gnused bzip2 gawk ed xz patch bash python3
         ncurses libffi zlib gmp pcre gnugrep
         coreutils findutils diffutils patchutils ninja;
 
@@ -332,7 +329,7 @@ in rec {
         libxml2-nopython = super.libxml2.override { pythonSupport = false; };
         CF = super.darwin.CF.override {
           libxml2 = libxml2-nopython;
-          python = prevStage.python;
+          python3 = prevStage.python3;
         };
       };
     };
@@ -365,17 +362,6 @@ in rec {
         });
       in { inherit tools libraries; } // tools // libraries);
 
-      # N.B: the important thing here is to ensure that python == python2
-      # == python27 or you get weird issues with inconsistent package sets.
-      # In a particularly subtle bug, I overrode python2 instead of python27
-      # here, and it caused gnome-doc-utils to complain about:
-      # "PyThreadState_Get: no current thread". This is because Python gets
-      # really unhappy if you have Python A which loads a native python lib
-      # which was linked against Python B, which in our case was happening
-      # because we didn't override python "deeply enough". Anyway, this works
-      # and I'm just leaving this blurb here so people realize why it matters
-      python27 = super.python27.override { CF = prevStage.darwin.CF; };
-
       darwin = super.darwin // {
         inherit (darwin) dyld ICU Libsystem libiconv;
       } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
@@ -438,7 +424,8 @@ in rec {
       inherit cc;
 
       darwin = super.darwin // {
-        xnu = super.darwin.xnu.override { python = super.python.override { configd = null; }; };
+        inherit (prevStage.darwin) CF;
+        xnu = super.darwin.xnu.override { inherit (prevStage) python3; };
       };
     });
   };