Get "cabal repl" to dump ghc options?

Hi, The cabal repl command works out a bunch of GHC options. Is there any way to dump these options without actually starting the repl? In particular, things like this: ghcOptPackageDBs = [ GlobalPackageDB , SpecificPackageDB \"/home/carlo/foo/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d\",SpecificPackageDB \"dist/package.conf.inplace\" ] Basically it would be nice to get the contents of replOpts just before this bit of code: https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/GHC.h... -- Carlo Hamalainen http://carlo-hamalainen.net

Hi Carlo, On Wed, May 14, 2014 at 05:34:44AM +0000, Carlo Hamalainen wrote:
The cabal repl command works out a bunch of GHC options. Is there any way to dump these options without actually starting the repl?
In particular, things like this:
ghcOptPackageDBs = [ GlobalPackageDB , SpecificPackageDB \"/home/carlo/foo/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d\",SpecificPackageDB \"dist/package.conf.inplace\" ]
cabal-cargs[1] might be of help: $> cabal-cargs --format=pure --only=package_db /home/dan/projekte/layers/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d Greetings, Daniel [1] https://github.com/dan-t/cabal-cargs

Hi, On 2014-05-14 at 07:34:44 +0200, Carlo Hamalainen wrote: [...]
The cabal repl command works out a bunch of GHC options. Is there any way to dump these options without actually starting the repl?
Here's a hack I sometimes use to that effect: create a script 'fakeghc.sh' with the following contents (or a similiar program): ,---- | #!/bin/sh | | case "$1" in | --interactive) | echo "$*" | exit | ;; | esac | | exec ghc $* `---- and then invoke cabal like so | cabal repl --with-ghc=./fakeghci.sh HTH, hvr

On 14/05/14 11:52, Herbert Valerio Riedel wrote:
Here's a hack I sometimes use to that effect: create a script 'fakeghc.sh' with the following contents (or a similiar program):
,---- | #!/bin/sh | | case "$1" in | --interactive) | echo "$*" | exit | ;; | esac | | exec ghc $* `----
and then invoke cabal like so
| cabal repl --with-ghc=./fakeghci.sh
Thanks, I think that this will be useful for my needs. -- Carlo Hamalainen http://carlo-hamalainen.net
participants (3)
-
Carlo Hamalainen
-
Daniel Trstenjak
-
Herbert Valerio Riedel