Interleaving per-component hooks with build

ÉRDI Gergő gergo at erdi.hu
Tue Apr 6 10:16:23 UTC 2021


On Mon, 15 Mar 2021, ÉRDI Gergő wrote:

> So my problem is that the package DB returned by `absolutePackageDBPaths $ 
> withPackageDB localInfo` doesn't contain the just-build library, even though 
> (supposedly) the library has already been built by that point.

I've figured out the solution to this one (after not receiving any replies 
on this thread for almost a month...): I was missing the so-called 
"internal package DB". For anyone interested, the following Haskell module 
defines `withComponentHook`, a build hook transformator that allows each 
component's `BuildInfo` to be edited just before building them:

https://github.com/gergoerdi/clashilator/blob/c2561e8465ba235aa4836e3bfae35f84fa578d26/src/Clash/Clashilator/Cabal.hs

Illustrating its use is the following module:

https://github.com/gergoerdi/clashilator/blob/c2561e8465ba235aa4836e3bfae35f84fa578d26/src/Clash/Clashilator/Setup.hs

I'm opening a Cabal ticket to hopefully start a conversation on adding 
something similar to Cabal itself.

G


More information about the cabal-devel mailing list