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

View File

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