From 0dc64d5d7197dead209aff7bffc4ddbf6da2cb31 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 27 Feb 2021 08:55:38 +0100 Subject: [PATCH] python: fix full builds by referring to the correct interpreter The package set is an attribute of the interpreter. The function to build an environment (`buildEnv`/`withPackages`) is part of the interpreter. The interpreter is passed to itself, and needs to be updated when overridden. For cross-compilation we splice the package set, and for that the various `build/host` interpreters and sets need to be available. We select these currently through `pkgs.${pythonAttr}`. The `pythonAttr` attribute was not fixed for `pythonFull`. https://github.com/NixOS/rfcs/pull/83 https://github.com/NixOS/nixpkgs/pull/104201 We need a better solution for this because this is very brittle. --- pkgs/development/interpreters/python/default.nix | 1 + pkgs/top-level/all-packages.nix | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 4cf245f26a98e..c212e37a484b5 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -191,6 +191,7 @@ in { # Minimal versions of Python (built without optional dependencies) python3Minimal = (python38.override { self = python3Minimal; + pythonAttr = "python3Minimal"; # strip down that python version as much as possible openssl = null; readline = null; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e481487617a7b..063205a3f173d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11431,38 +11431,46 @@ in # These are for compatibility and should not be used inside Nixpkgs. pythonFull = python.override { self = pythonFull; + pythonAttr = "pythonFull"; x11Support = true; }; python2Full = python2.override { self = python2Full; + pythonAttr = "python2Full"; x11Support = true; }; python27Full = python27.override { self = python27Full; + pythonAttr = "python27Full"; x11Support = true; }; python3Full = python3.override { self = python3Full; + pythonAttr = "python3Full"; bluezSupport = true; x11Support = true; }; python36Full = python36.override { self = python36Full; + pythonAttr = "python36Full"; bluezSupport = true; x11Support = true; }; python37Full = python37.override { self = python37Full; + pythonAttr = "python37Full"; bluezSupport = true; x11Support = true; }; python38Full = python38.override { self = python38Full; + pythonAttr = "python38Full"; bluezSupport = true; x11Support = true; }; python39Full = python39.override { self = python39Full; + pythonAttr = "python39Full"; bluezSupport = true; x11Support = true; };