NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

Hoogle service not building (regression in nixos 21.05) #125613

Open chris-martin opened 3 years ago

chris-martin commented 3 years ago

I just attempted to switch channels from 20.09 to 21.05. NixOS build fails with the following message:

error: A definition for option `services.hoogle.packages.[function body].[definition 1-entry 6]' is not of type `package'. Definition values:
- In `/home/chris/nix/os/hoogle.nix': null
(use '--show-trace' to show detailed location information)

My hoogle.nix file looks like this:

{ pkgs, ... }:
{
  services.hoogle.enable = true;
  services.hoogle.port = 13723;
  services.hoogle.haskellPackages = (import <nixpkgs> { }).haskellPackages;
  services.hoogle.packages = p: [
    p.acme-functors
    p.aeson
    ... etc ...

I do not see anything in the release notes affecting hoogle, so this seems like a mistake. I suspect the culprit is 8ac4b251c8a319909a29aa103101eeed82ca7d3e.

collares commented 3 years ago

You can't add core libraries to the package list because they get nulled out here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix#L10. This is not new to NixOS 21.05, but previously nulls were silently filtered out and now your returned package list does not typecheck. I assume core libraries are already part of the Hoogle documentation anyway.

I looked at your hoogle.nix (it's in a public repo of yours) and you should remove p.binary, p.bytestring, p.containers, p.directory, p.ghc-prim, p.mtl, p.stm, p.text, p.time and p.transformers since all of these evaluate to null.

collares commented 3 years ago

Of course, this is still a bug, since one of the examples in the Hoogle NixOS module is text, a core library.

cc @Infinisil

chris-martin commented 3 years ago

Thank you, that did it. It does also seem worth mentioning in the release notes.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info