From d8daa7af738311a68bacf5af1e4ff9e246a13e47 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Wed, 16 Jun 2021 10:32:20 +0800 Subject: [PATCH] haskellPackages.shellFor: Work around hoogle generation failure Workaround for https://github.com/NixOS/nixpkgs/issues/82245 Although this doesn't tackle the root cause of a null package sneaking in (via executableHaskellDepends), it does effectively treat the symptom by just ignoring any null packages. Seeing as that issue has been open for more than a year I think this band-aid is necessary. --- pkgs/development/haskell-modules/hoogle.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix index cfa06b045de2..d55f37f980d8 100644 --- a/pkgs/development/haskell-modules/hoogle.nix +++ b/pkgs/development/haskell-modules/hoogle.nix @@ -63,10 +63,13 @@ buildPackages.stdenv.mkDerivation { passAsFile = ["buildCommand"]; buildCommand = '' - ${lib.optionalString (packages != [] -> docPackages == []) + ${let # Filter out nulls here to work around https://github.com/NixOS/nixpkgs/issues/82245 + # If we don't then grabbing `p.name` here will fail. + packages' = lib.filter (p: p != null) packages; + in lib.optionalString (packages' != [] -> docPackages == []) ("echo WARNING: localHoogle package list empty, even though" + " the following were specified: " - + lib.concatMapStringsSep ", " (p: p.name) packages)} + + lib.concatMapStringsSep ", " (p: p.name) packages')} mkdir -p $out/share/doc/hoogle echo importing builtin packages