Commit 20a0e1b2 authored by Doron Behar's avatar Doron Behar
Browse files

python3: propagate overrides of spliced pythons

This is a more accurate resurrection of what was meant to be done in
64214826
parent 825a7f00
Loading
Loading
Loading
Loading
+31 −3
Original line number Diff line number Diff line
@@ -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 {
          python = attr.override (
            inputs'
            // {
              self = python;
          };
            }
          );
        in
        python;
      pythonVersion = with sourceVersion; "${major}.${minor}";