
As far as I have understood ghc-mod code for supporting Cabal, they do parse cabal file, but rather cherry pick individual options and generate GHC options manually. In hdevtools I use the code from Cabal to generate the same set of GHC options that will be use by Cabal itself to compile code in package. Thus, ghc-mod do not have problems with filtering -Werror, but though it doesn't handle extra options and/or flags (e.g. -Dsymbol CLI options).
Not sure what new functionality in Cabal you are referring to, but I should notice that currently Hdevtools is built with Cabal 1.16 library and not with 1.18. Thus I had to reimplement sandbox detection. The problem is that Hdevtools depend on "ghc" package and "ghc" (for some reason) depend on "Cabal" (and thus the version is a bit outdated). With release of GHC-7.8 Cabal 1.18 will be official and Hdevtools could start using it's built-in functionality for detecting sandbox etc.
On Feb 22, 2014, at 13:21, Carlo Hamalainen
On 22/02/14 04:46, Maxim Kulkin wrote:
Thanks for the support Joey!
Could you send me the full list of GHC options that your application is built with. You can do that by issuing "cabal build -v" and then finding options that you ghc is run with. I do not need list of your modules or your defines though. That would help.
This is one downside of using all GHC options. I have already done workaround for -Werror and seems like there are other situations that cause problems (looks like CPP warnings for some reason cause preprocessing fail).
Does ghc-mod handle this case? It has some code for automatically finding a project's cabal file and/or sandbox.
Also the latest Cabal library has some functionality (related to what happens when you call "cabal repl") that both hdevtools and ghc-mod (and even my project ghc-imported-from) could benefit from. There's no reason to duplicate the work that is already done in Cabal for working out GHC options, cabal package options, etc.
-- Carlo Hamalainen http://carlo-hamalainen.net
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe