ndmitchell / ndmitchell/hoogle

`hoogle generate --local` ignores `haddock-html` field

Open
#471 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
803
Forks
152
PR merge metrics
No merged PRs in 30d

Description

Tested at commit e11273ec17c54f83344861e332580996f9f4127e.

When I try to generate a Hoogle database on NixOS (in a Nix shell that provides GHC, Cabal, and Hoogle), I get the following error:

$ hoogle generate --local --database db.hoo
Starting generate
Reading ghc-pkg... 0.03s

Packages missing documentation: array base binary bytestring Cabal Cabal-syntax containers deepseq directory exceptions filepath ghc ghc-bignum ghc-boot ghc-boot-th ghc-compact ghc-experimental ghc-heap ghc-internal ghc-platform ghc-prim ghc-toolchain ghci haskeline hpc integer-gmp mtl os-string parsec pretty process rts semaphore-compat stm system-cxx-std-lib template-haskell terminfo text time transformers unix xhtml
No packages were found, aborting (use no arguments to index all of Stackage)

I found that the readGhcPkg function made too many assumptions about the location of package documentation.

I have a fix here, but I think the code could be improved.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the readGhcPkg function used by hoogle generate --local and reproduce the NixOS command from the issue. Check how ghc-pkg entries expose haddock-html, then verify that generation discovers the installed package documentation instead of aborting with no packages found.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.