on iko/ghcjs-patch-master help sign in
dontRecurseIntoAttrs to prevent infinite recursion (#665)
56e5525Hamish Mackenzie
overlays/haskell.nix+20−17
@@ -476,23 +476,26 @@ final: prev: {
476 # components so they have a `.project` attribute and as well as
476 # components so they have a `.project` attribute and as well as
477 # a `.package` attribute on the components.
477 # a `.package` attribute on the components.
478 addProjectAndPackageAttrs = rawProject:
478 addProjectAndPackageAttrs = rawProject:
479− final.lib.fix (project: rawProject // {
479+ final.lib.fix (project':
480+ let project = final.lib.dontRecurseIntoAttrs project';
481+ in rawProject // {
480− hsPkgs = (final.lib.mapAttrs (n: package:
482+ hsPkgs = (final.lib.mapAttrs (n: package':
481− if package == null
483+ if package' == null
482− then null
484+ then null
483− else
485+ else
486+ let package = final.lib.dontRecurseIntoAttrs package';
484− package // {
487+ in package' // {
485− components = final.lib.mapAttrs (n: v:
488+ components = final.lib.mapAttrs (n: v:
486− if n == "library" || n == "all"
489+ if n == "library" || n == "all"
487− then v // { inherit project package; }
490+ then v // { inherit project package; }
488− else final.lib.mapAttrs (_: c: c // { inherit project package; }) v
491+ else final.lib.mapAttrs (_: c: c // { inherit project package; }) v
489− ) package.components;
492+ ) package'.components;
490− inherit project;
493+ inherit project;
491− }
494+ }
492− ) rawProject.hsPkgs
495+ ) rawProject.hsPkgs
493− // {
496+ // {
494− # These are functions not packages
497+ # These are functions not packages
495− inherit (rawProject.hsPkgs) shellFor ghcWithHoogle ghcWithPackages;
498+ inherit (rawProject.hsPkgs) shellFor ghcWithHoogle ghcWithPackages;
496 });
499 });
497 });
500 });
498
501