albertodvp
albertodvp

Reputation: 31

Create a complete hoogle database for a cabal project with all dependencies included

I am trying to generate a hoogle database for a cabal project. I would like to have the documentation for dependencies too.

I tried different approaches but in all the cases my hoogle database is incomplete (some dependencies are missing). My constraints:

I have different projects inside my cabal.project file.

Things I tried:

Regular cabal

cabal haddock all --haddock-hoogle --haddock-html --keep-going --haddock-quickjump

It seems that currently we cannot do that.

Anyway, I’m a bit puzzled here because in my project I had some dependencies under a source-repository-package stanza with some broken haddock I had to fix those in order to run cabal haddock successfully - I am wondering whether that comment is outdated or am I not understanding something here. Any idea? In any case, I can get the databases for the project packages but not for the dependencies.

Cabal haddock-project

I tried to use this by manually installing a more recent version of haddock, basically following coot's guide but the tool is actually checking GHC versions: here is the error message I have:

    
    The GHC version is 8.10.7 but haddock is using GHC version 9.4.8

cabal-hoogle

I found this cabal-hoogle. The tool is simple and does not have many flags so I just followed the documentation and I managed to create a database but some dependencies are missing (in fact many of them), anyway this was the best solution I found so far.

cabal-hoogle is using cabal and hoogle APIs directly so I think I will start digging into it if I don’t find better solutions.


Questions

Do you see anything wrong in what I tried to do and/or do you have any advice on how to proceed on this?

With the knowledge I have, I think my next step would be start digging into cabal/cabal-hoogle to better understand what's going on, do you have any other approach to suggest?

Upvotes: 3

Views: 162

Answers (0)

Related Questions