Skip to content
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

haskell/hoogle.nix: make an empty packages list possible #20619

Merged
merged 1 commit into from
Nov 25, 2016

Conversation

Profpatsch
Copy link
Member

Building hoogle environments with an empty list of packages threw a built-time
error. This was particularly confusing when giving e.g. (hps: [hps.Cabal])
which, since Cabal is set to null (because it’s a distribution package),
would have lead to the same error as an empty list.

It was not useful to throw an error at all, because sometimes one only wants to
build an environment for the distribution packages. We switch to displaying a
warning (because it might be that the user made a mistake).

  • tested with an empty list
  • tested with a non-empty list

cc @peti @cstrahan

@mention-bot
Copy link

@Profpatsch, thanks for your PR! By analyzing the history of the files in this pull request, we identified @cstrahan, @oxij and @mdorman to be potential reviewers.

@@ -51,21 +51,19 @@ let
else writeText "ghcjs-prologue.txt" ''
This index includes documentation for many Haskell modules.
'';

docPackages = (lib.closePropagation packages);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose those brackets are no longer necessary.

@peti
Copy link
Member

peti commented Nov 21, 2016

I'm not fond of the warning. If we consider [] a valid input, then the expression should just work -- no warnings, nothing. If we consider [] an invalid input, then the expression should throw an error at the time of evaluation.

@Profpatsch Profpatsch force-pushed the ghcWithHoogle-empty-packagelist branch from 41b9440 to 8b68e0e Compare November 21, 2016 21:25
@Profpatsch
Copy link
Member Author

You are right. I also noticed ghc.ghc as default value doesn’t make any sense (for one because it doesn’t even exist). Fixed.

@peti
Copy link
Member

peti commented Nov 23, 2016

Very cool. Once #20619 (comment) is addressed, I'd be happy to merge.

Building hoogle environments with an empty list of packages threw a built-time
error. This was particularly confusing when giving e.g. `(hps: [hps.Cabal])`
which, since `Cabal` is set to `null` (because it’s a distribution package),
would have lead to the same error as an empty list.

It was not useful to throw an error at all, because sometimes one only wants to
build an environment for the distribution packages; also the default value for
packages wasn’t even a valid value, so it is removed.
@Profpatsch Profpatsch force-pushed the ghcWithHoogle-empty-packagelist branch from 8b68e0e to b8a69aa Compare November 24, 2016 11:32
@Profpatsch
Copy link
Member Author

Right, fixed.

@peti peti merged commit baea6a8 into NixOS:master Nov 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants