[Haskell-cafe] Integrate GHC-API with Cabal
imantc at gmail.com
Wed Jul 25 09:59:45 UTC 2018
cabal-install package includes useful modules. With these modules it is
possible to read the actual build info. These modules could be added to the
What are the reasons cabal-install can not be added as a project dependency?
Can some modules be moved from cabal-install to Cabal library?
On 25 July 2018 at 11:33, Félix Baylac <felix at alternativebit.fr> wrote:
> Dear cafe,
> I am currently working on a project  which aims to index the code
> published on
> Stackage in order to provide a "code example" database. Basically, for each
> library, I want to generate a real-world example corpus for each exported
> Before generating this database, I need to retrieve the exported symbol of
> package. So far, I have been gathering the dependencies and integrating
> them in
> the GHC pkg database using an external stack call, I then parse the cabal
> and load the exposed modules using the GHC API and gather the exported
> It works pretty reliably on the simple packages, however, I end up with
> missing dynamic flags for some more advanced packages (missing c includes,
> libraries, ASM flags, etc.). I then started to parse and load these
> attributes to GHC until I stepped back for a moment and realized I was
> re-implementing cabal build.
> I then looked for a way to "hook" my GHC API code in cabal build. This
> allow cabal to both handle the dependencies gathering as well as setting
> up the
> correct GHC dyn-flags. The only resource I found was . It's really
> however, looks a bit hacky to me.
> Is there a better way to perform this kind of "hook"?
>  https://git.alternativebit.fr/NinjaTrappeur/Exhs
>  http://blog.ezyang.com/2017/02/how-to-integrate-ghc-api-
> * I am aware of the hoogle index generated by haddock. However, this index
> missing when the haddock documentation of a package cannot be generated.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cabal-devel