<div dir="ltr"><div><div><div><div><div>Hi Edward,<br><br></div>I can do with current Cabal, it is just a lot of boilerplate and inconvenience.<br></div>What I would like to have as an ideal solution for my problem is a preprocessor interface similar to PPSuffixHandler, but with extra capabilities.<br></div>It should receive one file as an input, but be able to generate multiple modules with the names of its own choosing. And I want the resulting modules to be added to all build steps automatically. So it should looks approximately like this:<br><br>data SmartPreProcessor = SmartPreProcessor {<br>    platformIndependent :: Bool,
  <br>    runPreProcessor :: (FilePath, FilePath) -- Location of the source file relative to a base dir
                  <br>                    -> Verbosity                       -- verbosity
                  <br>                    -> FilePath                         -- output base dir
                  <br>                    -> IO [FilePath]               -- output sources files. Should exit if the preprocessor fails
  <br>}<br><br></div>There may be design objections to such preprocessor, but again, this is an ideal solution to my problem.<br></div><div><div><div><br>On Sun, Mar 6, 2016 at 11:55 PM Edward Z. Yang <<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Andrey,<br>
<br>
I do not know what the right way to sovle your problem is, but if it is<br>
indeed the case that this cannot be done with Cabal, speaking as a Cabal<br>
developer, we definitely should try to fix this.  A bug report<br>
would be much appreciated.<br>
<br>
> So, I have buildHook, copyHook and regHook replaced with wrappers which<br>
> change PackageDescription parameter and call original function. Library is<br>
> built and installed, but somewhere between build and copy actions there is<br>
> still a message "Warning: modules not listed in foo.cabal for library<br>
> component (add to other-modules)". I can't identify where it comes from.<br>
<br>
I'm pretty sure this message comes from Stack; src/Stack/Types/Package.hs.<br>
<br>
Cheers,<br>
Edward<br>
</blockquote></div></div></div></div></div>