Skip to content

Commit

Permalink
Fix infinite recursion for aliases in pkgs/top-level/python-aliases.nix
Browse files Browse the repository at this point in the history
This fixes #750.
  • Loading branch information
SemMulder committed Oct 31, 2022
1 parent 289efb1 commit 4dccae6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ let
lib.strings.toLower (lib.strings.concatStringsSep "-" partsWithoutSeparator);

# Normalize an entire attrset of packages
normalizePackageSet = lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair (normalizePackageName name) value);
normalizePackageSet = packageSet: lib.attrsets.mapAttrs'
(name: value:
let normalizedName = normalizePackageName name; in
if (builtins.hasAttr normalizedName packageSet) then
# Prevent infinite recursion for aliases in nixpkgs/pkgs/top-level/python-aliases.nix
lib.attrsets.nameValuePair name value
else
lib.attrsets.nameValuePair normalizedName value
)
packageSet;

# Get a full semver pythonVersion from a python derivation
getPythonVersion = python:
Expand Down

0 comments on commit 4dccae6

Please sign in to comment.