Interleaving per-component hooks with build

ÉRDI Gergő gergo at
Wed Mar 3 01:10:28 UTC 2021


I am looking for a way to do custom preprocessing for each component (of 
type `UnitId -> IO ()`) but this preprocessing depends on the dependencies 
of the component being already built. So imagine a Cabal file which 
defines a library and an exe, with the exe depending on the library. Then, 
I would need the following sequence of events to happen during 

1. myPreprocessing unitIdOfLibrary
2. standard build of library
3. myPreprocessing unitIdOfExe
4. standard build of exe

How can I achieve that without copy-pasting large parts of the internals 
of `buildHook simpleUserHooks`?


More information about the cabal-devel mailing list