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.
This commit is contained in:
Frederik Rietdijk 2021-02-27 08:55:38 +01:00 committed by Frederik Rietdijk
parent 206c4d3bb1
commit 0dc64d5d71
2 changed files with 9 additions and 0 deletions

@ -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;

@ -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;
};