haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 697 forks source link

Add feature to generate cabal_macros.h #2209

Open nh2 opened 10 years ago

nh2 commented 10 years ago

We would like to generate and use cabal_macros.h (e.g. for hlint or our ghc -M based build system) without actually running cabal build.

I was surprised that cabal_macros.h is created by cabal build only, and not by cabal configure.

Also, while you can do cabal build mytarget, there isn't an empty target, so there currently is no way to tell cabal to only generate cabal_macros.h and do no further compilation.

It would be great to have a way to generate only cabal_macros.h; maybe via one of these alternatives:

23Skidoo commented 10 years ago

make it part of cabal configure

IMO, this makes more sense than the current situation. @dcoutts, is there any reason this is done at build time?

jneira commented 4 years ago

This is a really old one but we are hitting it in the haskell-ide-engine branch that uses cabal-helper to load packages in the ide: as cabal-helper does only a cabal v2-build --only-configure the header is not created and it makes required build the project before open it with the editor.