-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haskellPackages.shellFor with hoogle enabled fails with null dependencies #82245
Comments
Ping @Ericson2314. It is possible this was introduced in either #80845 or #76349. Also ping @jmininger and @matthewbauer, who did reviews on these issues. Also, @alexpeits, if you'd like to look into this, I'm hoping the fix wouldn't be too tricky. |
Surprisingly what causes the issue is this warning message nixpkgs/pkgs/development/haskell-modules/hoogle.nix Lines 66 to 69 in 001be89
(if I remove the concatMapStringsSep call it works). Seems like packages is a list which contains a null for some reason that I can't figure out, but I'll look into it a bit more
|
I had the same issue, previous suggestion worked. |
https://github.com/NixOS/nixpkgs/pull/42368/files this revert would seem to reintroduce the issue, but the issue was not reopened. |
Today I experienced this error with nixos-20.03, which is weird given that by reading this thread I got the idea that this was already fixed. Edit: I think this is because the package I was using does not have an executable, but the package only depends on base. How can I work around this? shell = myHaskellPackages.shellFor {
packages = p: [
p."laop"
];
buildInputs = with pkgs.haskellPackages; [
myHaskellPackages.cabal-install
pkgs.neo4j
(import sources.niv {}).niv
pkgs.nixpkgs-fmt
];
withHoogle = true;
}; |
Blocked-By: NixOS/nixpkgs#82245 Fixes Gabriella439#33
- We have to use 'useHoogle = false;' due to a bug described at NixOS/nixpkgs#82245
I marked this as stale due to inactivity. → More info |
This bug still occurs for me on |
I have also encountered the same issue. Are there any workarounds? |
@jul1u5 I haven't taken a good look at this, but from reading the thread it sounds like these are your options:
Everyone would probably appreciate if you did 4., but that is probably the most time-consuming solution in this list :-) |
Thanks for the quick response!
|
Also see #108100 which may have some additional information about this bug. |
Although this doesn't tackle the root cause of a diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix
index cfa06b045de..fb2f893943c 100644
--- a/pkgs/development/haskell-modules/hoogle.nix
+++ b/pkgs/development/haskell-modules/hoogle.nix
@@ -63,10 +63,11 @@ buildPackages.stdenv.mkDerivation {
passAsFile = ["buildCommand"];
buildCommand = ''
- ${lib.optionalString (packages != [] -> docPackages == [])
+ ${let 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 |
Workaround for NixOS#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.
Describe the bug
On the
nixpkgs-unstable
branch, when there are no haskell dependencies other than base (and other common ones liketext
) inbuild-depends
in the cabal file, starting a shell with hoogle enabled gives the error:To Reproduce
Steps to reproduce the behavior:
default.nix
:testpkg.cabal
:nix-shell
Expected behavior
The nix shell is initialized, and running
hoogle server --local
runs a hoogle server. Adding another dependency inbuild-depends
, e.g.lens
, results in the expected behaviour.Additional context
The issue seems similar to this closed issue
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: