python3: break infinite recursion

Checking if bluez is a derivation requires evaluating whether an
emulator is available (in the case that gobject-introspection is
available), which when cross compiling requires evaluating qemu, which
requires evaluating libxml2, which requires evaluating Python.

The recursion break happens in the Python expression because it's the
thing behaving unusually, by forcing evaluation of all of its
arguments, even ones that are optional and unused.

Fixes: 8b3a4a617e ("bluez: fix when gobject-introspection unsupported")
This commit is contained in:
Alyssa Ross 2024-08-17 10:58:13 +02:00
parent 575514d0f3
commit 007088359e

View File

@ -130,7 +130,8 @@ let
passthru = let
# When we override the interpreter we also need to override the spliced versions of the interpreter
inputs' = lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun") inputs;
# bluez is excluded manually to break an infinite recursion.
inputs' = lib.filterAttrs (n: v: n != "bluez" && n != "passthruFun" && ! lib.isDerivation v) inputs;
override = attr: let python = attr.override (inputs' // { self = python; }); in python;
in passthruFun rec {
inherit self sourceVersion packageOverrides;