python3: propagate overrides of spliced pythons

This is a more accurate resurrection of what was meant to be done in
6421482683
This commit is contained in:
Doron Behar
2026-03-09 16:20:08 +02:00
parent 825a7f002c
commit 20a0e1b210

View File

@@ -165,12 +165,40 @@ let
);
}
// __splices;
# When we override the interpreter we also need to override the spliced
# versions of the interpreter. NOTE: In lua-5/interpreter.nix, this
# filter is different - we take every attribute from @inputs, besides
# derivations. That filter causes cross compilations issues for Python
# See e.g:
#
# pkgsCross.armv7l-hf-multiplatform.buildPackages.python3Packages.bcrypt
#
# And the following Nixpkgs issues/PRs:
#
# - https://github.com/NixOS/nixpkgs/issues/48046
# - https://github.com/NixOS/nixpkgs/pull/480005 (Wrong PR)
# - https://github.com/NixOS/nixpkgs/pull/482866 (Correct fix)
# - https://github.com/NixOS/nixpkgs/pull/498251 (Re-adds this @inputs filter)
inputs' = lib.filterAttrs (
n: v:
(builtins.elem (builtins.typeOf v) [
"int"
"bool"
"string"
"path"
"null"
])
|| n == "packageOverrides"
) inputs;
override =
attr:
let
python = attr.override {
self = python;
};
python = attr.override (
inputs'
// {
self = python;
}
);
in
python;
pythonVersion = with sourceVersion; "${major}.${minor}";