make "cabal repl" run a custom preprocessor before loading

Hi Cafe, I'm wondering how to run a custom preprocessor with "cabal repl"? The case is that I have a package with an executable and a library. The executable works fine with "ghc-options: -F -pgmF ./xxx.sh" in its cabal config section, but the library seems to ignore it when I put the same line into the library's section and then run "cabal repl". Also, the substitutions didn't happen when running GHC directly with -F and -pgmF in expression mode (-e). -- Markus Läll

Hi Markus,
On Thu, May 15, 2014 at 1:54 PM, Markus Läll
The case is that I have a package with an executable and a library. The executable works fine with "ghc-options: -F -pgmF ./xxx.sh" in its cabal config section, but the library seems to ignore it when I put the same line into the library's section and then run "cabal repl". Also, the substitutions didn't happen when running GHC directly with -F and -pgmF in expression mode (-e).
This is probably an oversight/limitation. Please file a bug at https://github.com/haskell/cabal/issues -- Johan

So of course it does work after removing a typo in a test function! Ignore
me..
On Thu, May 15, 2014 at 1:54 PM, Markus Läll
Hi Cafe,
I'm wondering how to run a custom preprocessor with "cabal repl"?
The case is that I have a package with an executable and a library. The executable works fine with "ghc-options: -F -pgmF ./xxx.sh" in its cabal config section, but the library seems to ignore it when I put the same line into the library's section and then run "cabal repl". Also, the substitutions didn't happen when running GHC directly with -F and -pgmF in expression mode (-e).
-- Markus Läll
-- Markus Läll

Hi,
I'm wondering how to run a custom preprocessor with "cabal repl"?
You can try putting {-# OPTIONS_GHC -F -pgmF ... #-} at the top of your source file. That works fine for me with e.g. [1]. Cheers, Simon [1] https://github.com/sol/hspec-example/blob/master/test/Spec.hs
participants (3)
-
Johan Tibell
-
Markus Läll
-
Simon Hengel