ndmitchell / ndmitchell/hoogle

Parsing of ghc-pkg output by Input.Cabal.readGhcPkg is broken

Open
#350 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Different versions of GHC have different output format for ghc-pkg. For example I got different output under GHC 8.2.2 vs GHC 8.8.3: https://gist.github.com/jchia/cf4412d7402f7bfeb01324b9cd537986

One way the brokenness manifests is that with GHC 8.8.3, hoogle generate thinks that the packageDocs is Just "", and that the package name has some leading spaces, resulting in hoogle generate failing with "No packages were found, aborting (use no arguments to index all of Stackage)" because it thinks that none of the packages have documentation.

What about using Distribution.InstalledPackageInfo from Cabal? It may be a big change, but this way is less fragile than internal ad-hoc parsing, and I don't know what other problems there are already that result from broken parsing.

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 in Input.Cabal.readGhcPkg and compare its parsing assumptions with the GHC 8.2.2 and 8.8.3 ghc-pkg output linked in the issue. Investigate whether Distribution.InstalledPackageInfo from Cabal can replace the ad-hoc parsing. Done means hoogle generate discovers packages and their documentation across the reported GHC versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.